diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 8fd37cf545ed1..94e45fae157ad 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -300,6 +300,7 @@ com.azure.resourcemanager:azure-resourcemanager-maps;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-botservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-deviceprovisioningservices;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-privatedns-generated;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index 8a459dd59a622..6eca15e531518 100644 --- a/pom.xml +++ b/pom.xml @@ -707,6 +707,7 @@ eng/code-quality-reports eng/jacoco-test-coverage sdk/advisor + sdk/agrifood sdk/anomalydetector sdk/apimanagement sdk/appconfiguration @@ -751,7 +752,6 @@ sdk/digitaltwins sdk/eventgrid sdk/eventhubs - sdk/agrifood sdk/formrecognizer sdk/frontdoor sdk/hanaonazure @@ -789,6 +789,7 @@ sdk/policyinsights sdk/postgresql sdk/powerbidedicated + sdk/privatedns sdk/purview sdk/quantum sdk/recoveryservices diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/CHANGELOG.md b/sdk/privatedns/azure-resourcemanager-privatedns-generated/CHANGELOG.md new file mode 100644 index 0000000000000..d13ca63d276ed --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-06-28) + +- Azure Resource Manager PrivateDns client library for Java. This package contains Microsoft Azure SDK for PrivateDns Management SDK. The Private DNS Management Client. Package tag package-2020-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/README.md b/sdk/privatedns/azure-resourcemanager-privatedns-generated/README.md new file mode 100644 index 0000000000000..bc047ff52d707 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager PrivateDns client library for Java + +Azure Resource Manager PrivateDns client library for Java. + +This package contains Microsoft Azure SDK for PrivateDns Management SDK. The Private DNS Management Client. Package tag package-2020-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-privatedns-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-privatedns-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +PrivateDnsManager manager = PrivateDnsManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/pom.xml b/sdk/privatedns/azure-resourcemanager-privatedns-generated/pom.xml new file mode 100644 index 0000000000000..fc7b21bb18c22 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-privatedns-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for PrivateDns Management + This package contains Microsoft Azure SDK for PrivateDns Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Private DNS Management Client. Package tag package-2020-06. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/PrivateDnsManager.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/PrivateDnsManager.java new file mode 100644 index 0000000000000..ab510c356915b --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/PrivateDnsManager.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.fluent.PrivateDnsManagementClient; +import com.azure.resourcemanager.privatedns.generated.implementation.PrivateDnsManagementClientBuilder; +import com.azure.resourcemanager.privatedns.generated.implementation.PrivateZonesImpl; +import com.azure.resourcemanager.privatedns.generated.implementation.RecordSetsImpl; +import com.azure.resourcemanager.privatedns.generated.implementation.VirtualNetworkLinksImpl; +import com.azure.resourcemanager.privatedns.generated.models.PrivateZones; +import com.azure.resourcemanager.privatedns.generated.models.RecordSets; +import com.azure.resourcemanager.privatedns.generated.models.VirtualNetworkLinks; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to PrivateDnsManager. The Private DNS Management Client. */ +public final class PrivateDnsManager { + private PrivateZones privateZones; + + private VirtualNetworkLinks virtualNetworkLinks; + + private RecordSets recordSets; + + private final PrivateDnsManagementClient clientObject; + + private PrivateDnsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new PrivateDnsManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of PrivateDns service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the PrivateDns service API instance. + */ + public static PrivateDnsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create PrivateDnsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new PrivateDnsManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of PrivateDns service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the PrivateDns service API instance. + */ + public PrivateDnsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.privatedns.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new PrivateDnsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of PrivateZones. */ + public PrivateZones privateZones() { + if (this.privateZones == null) { + this.privateZones = new PrivateZonesImpl(clientObject.getPrivateZones(), this); + } + return privateZones; + } + + /** @return Resource collection API of VirtualNetworkLinks. */ + public VirtualNetworkLinks virtualNetworkLinks() { + if (this.virtualNetworkLinks == null) { + this.virtualNetworkLinks = new VirtualNetworkLinksImpl(clientObject.getVirtualNetworkLinks(), this); + } + return virtualNetworkLinks; + } + + /** @return Resource collection API of RecordSets. */ + public RecordSets recordSets() { + if (this.recordSets == null) { + this.recordSets = new RecordSetsImpl(clientObject.getRecordSets(), this); + } + return recordSets; + } + + /** + * @return Wrapped service client PrivateDnsManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public PrivateDnsManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/PrivateDnsManagementClient.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/PrivateDnsManagementClient.java new file mode 100644 index 0000000000000..0f3855bed3d62 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/PrivateDnsManagementClient.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for PrivateDnsManagementClient class. */ +public interface PrivateDnsManagementClient { + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the PrivateZonesClient object to access its operations. + * + * @return the PrivateZonesClient object. + */ + PrivateZonesClient getPrivateZones(); + + /** + * Gets the VirtualNetworkLinksClient object to access its operations. + * + * @return the VirtualNetworkLinksClient object. + */ + VirtualNetworkLinksClient getVirtualNetworkLinks(); + + /** + * Gets the RecordSetsClient object to access its operations. + * + * @return the RecordSetsClient object. + */ + RecordSetsClient getRecordSets(); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/PrivateZonesClient.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/PrivateZonesClient.java new file mode 100644 index 0000000000000..562778b82a33e --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/PrivateZonesClient.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.privatedns.generated.fluent.models.PrivateZoneInner; + +/** An instance of this class provides access to all the operations defined in PrivateZonesClient. */ +public interface PrivateZonesClient { + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateZoneInner> beginCreateOrUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch); + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateZoneInner> beginCreateOrUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateZoneInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch); + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateZoneInner createOrUpdate(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters); + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateZoneInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateZoneInner> beginUpdate( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch); + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateZoneInner> beginUpdate( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, Context context); + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateZoneInner update( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch); + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateZoneInner update(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters); + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateZoneInner update( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, Context context); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String privateZoneName, String ifMatch); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateZoneName, String ifMatch, Context context); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateZoneName, String ifMatch); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateZoneName); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateZoneName, String ifMatch, Context context); + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateZoneInner getByResourceGroup(String resourceGroupName, String privateZoneName); + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateZoneName, Context context); + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer top, Context context); + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/RecordSetsClient.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/RecordSetsClient.java new file mode 100644 index 0000000000000..9a2cdcd78a181 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/RecordSetsClient.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.privatedns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.privatedns.generated.models.RecordType; + +/** An instance of this class provides access to all the operations defined in RecordSetsClient. */ +public interface RecordSetsClient { + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecordSetInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters); + + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecordSetInner update( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters); + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + Context context); + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName); + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param ifMatch The ETag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + String ifMatch, + Context context); + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecordSetInner get( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName); + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + Context context); + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByType(String resourceGroupName, String privateZoneName, RecordType recordType); + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByType( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context); + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateZoneName); + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String privateZoneName, Integer top, String recordsetnamesuffix, Context context); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/VirtualNetworkLinksClient.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/VirtualNetworkLinksClient.java new file mode 100644 index 0000000000000..340af9be0c29d --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/VirtualNetworkLinksClient.java @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.privatedns.generated.fluent.models.VirtualNetworkLinkInner; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkLinksClient. */ +public interface VirtualNetworkLinksClient { + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkLinkInner> beginCreateOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch); + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkLinkInner> beginCreateOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkLinkInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch); + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkLinkInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters); + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkLinkInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkLinkInner> beginUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch); + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualNetworkLinkInner> beginUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + Context context); + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkLinkInner update( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch); + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkLinkInner update( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters); + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkLinkInner update( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + Context context); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context); + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkLinkInner get(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName); + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, Context context); + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateZoneName); + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of virtual network links to return. If not specified, returns up to 100 virtual + * network links. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String privateZoneName, Integer top, Context context); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/PrivateZoneInner.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/PrivateZoneInner.java new file mode 100644 index 0000000000000..121edc31e1382 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/PrivateZoneInner.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Private DNS zone. */ +@JsonFlatten +@Fluent +public class PrivateZoneInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateZoneInner.class); + + /* + * The ETag of the zone. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The maximum number of record sets that can be created in this Private + * DNS zone. This is a read-only property and any attempt to set this value + * will be ignored. + */ + @JsonProperty(value = "properties.maxNumberOfRecordSets", access = JsonProperty.Access.WRITE_ONLY) + private Long maxNumberOfRecordSets; + + /* + * The current number of record sets in this Private DNS zone. This is a + * read-only property and any attempt to set this value will be ignored. + */ + @JsonProperty(value = "properties.numberOfRecordSets", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfRecordSets; + + /* + * The maximum number of virtual networks that can be linked to this + * Private DNS zone. This is a read-only property and any attempt to set + * this value will be ignored. + */ + @JsonProperty(value = "properties.maxNumberOfVirtualNetworkLinks", access = JsonProperty.Access.WRITE_ONLY) + private Long maxNumberOfVirtualNetworkLinks; + + /* + * The current number of virtual networks that are linked to this Private + * DNS zone. This is a read-only property and any attempt to set this value + * will be ignored. + */ + @JsonProperty(value = "properties.numberOfVirtualNetworkLinks", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfVirtualNetworkLinks; + + /* + * The maximum number of virtual networks that can be linked to this + * Private DNS zone with registration enabled. This is a read-only property + * and any attempt to set this value will be ignored. + */ + @JsonProperty( + value = "properties.maxNumberOfVirtualNetworkLinksWithRegistration", + access = JsonProperty.Access.WRITE_ONLY) + private Long maxNumberOfVirtualNetworkLinksWithRegistration; + + /* + * The current number of virtual networks that are linked to this Private + * DNS zone with registration enabled. This is a read-only property and any + * attempt to set this value will be ignored. + */ + @JsonProperty( + value = "properties.numberOfVirtualNetworkLinksWithRegistration", + access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfVirtualNetworkLinksWithRegistration; + + /* + * The provisioning state of the resource. This is a read-only property and + * any attempt to set this value will be ignored. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Private zone internal Id + */ + @JsonProperty(value = "properties.internalId", access = JsonProperty.Access.WRITE_ONLY) + private String internalId; + + /** + * Get the etag property: The ETag of the zone. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The ETag of the zone. + * + * @param etag the etag value to set. + * @return the PrivateZoneInner object itself. + */ + public PrivateZoneInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this Private DNS + * zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfRecordSets value. + */ + public Long maxNumberOfRecordSets() { + return this.maxNumberOfRecordSets; + } + + /** + * Get the numberOfRecordSets property: The current number of record sets in this Private DNS zone. This is a + * read-only property and any attempt to set this value will be ignored. + * + * @return the numberOfRecordSets value. + */ + public Long numberOfRecordSets() { + return this.numberOfRecordSets; + } + + /** + * Get the maxNumberOfVirtualNetworkLinks property: The maximum number of virtual networks that can be linked to + * this Private DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfVirtualNetworkLinks value. + */ + public Long maxNumberOfVirtualNetworkLinks() { + return this.maxNumberOfVirtualNetworkLinks; + } + + /** + * Get the numberOfVirtualNetworkLinks property: The current number of virtual networks that are linked to this + * Private DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the numberOfVirtualNetworkLinks value. + */ + public Long numberOfVirtualNetworkLinks() { + return this.numberOfVirtualNetworkLinks; + } + + /** + * Get the maxNumberOfVirtualNetworkLinksWithRegistration property: The maximum number of virtual networks that can + * be linked to this Private DNS zone with registration enabled. This is a read-only property and any attempt to set + * this value will be ignored. + * + * @return the maxNumberOfVirtualNetworkLinksWithRegistration value. + */ + public Long maxNumberOfVirtualNetworkLinksWithRegistration() { + return this.maxNumberOfVirtualNetworkLinksWithRegistration; + } + + /** + * Get the numberOfVirtualNetworkLinksWithRegistration property: The current number of virtual networks that are + * linked to this Private DNS zone with registration enabled. This is a read-only property and any attempt to set + * this value will be ignored. + * + * @return the numberOfVirtualNetworkLinksWithRegistration value. + */ + public Long numberOfVirtualNetworkLinksWithRegistration() { + return this.numberOfVirtualNetworkLinksWithRegistration; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. This is a read-only property and any + * attempt to set this value will be ignored. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the internalId property: Private zone internal Id. + * + * @return the internalId value. + */ + public String internalId() { + return this.internalId; + } + + /** {@inheritDoc} */ + @Override + public PrivateZoneInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateZoneInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/RecordSetInner.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/RecordSetInner.java new file mode 100644 index 0000000000000..c07d158437f6c --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/RecordSetInner.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.models.ARecord; +import com.azure.resourcemanager.privatedns.generated.models.AaaaRecord; +import com.azure.resourcemanager.privatedns.generated.models.CnameRecord; +import com.azure.resourcemanager.privatedns.generated.models.MxRecord; +import com.azure.resourcemanager.privatedns.generated.models.PtrRecord; +import com.azure.resourcemanager.privatedns.generated.models.SoaRecord; +import com.azure.resourcemanager.privatedns.generated.models.SrvRecord; +import com.azure.resourcemanager.privatedns.generated.models.TxtRecord; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS zone. */ +@JsonFlatten +@Fluent +public class RecordSetInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecordSetInner.class); + + /* + * The ETag of the record set. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The metadata attached to the record set. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /* + * The TTL (time-to-live) of the records in the record set. + */ + @JsonProperty(value = "properties.ttl") + private Long ttl; + + /* + * Fully qualified domain name of the record set. + */ + @JsonProperty(value = "properties.fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Is the record set auto-registered in the Private DNS zone through a + * virtual network link? + */ + @JsonProperty(value = "properties.isAutoRegistered", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isAutoRegistered; + + /* + * The list of A records in the record set. + */ + @JsonProperty(value = "properties.aRecords") + private List aRecords; + + /* + * The list of AAAA records in the record set. + */ + @JsonProperty(value = "properties.aaaaRecords") + private List aaaaRecords; + + /* + * The CNAME record in the record set. + */ + @JsonProperty(value = "properties.cnameRecord") + private CnameRecord cnameRecord; + + /* + * The list of MX records in the record set. + */ + @JsonProperty(value = "properties.mxRecords") + private List mxRecords; + + /* + * The list of PTR records in the record set. + */ + @JsonProperty(value = "properties.ptrRecords") + private List ptrRecords; + + /* + * The SOA record in the record set. + */ + @JsonProperty(value = "properties.soaRecord") + private SoaRecord soaRecord; + + /* + * The list of SRV records in the record set. + */ + @JsonProperty(value = "properties.srvRecords") + private List srvRecords; + + /* + * The list of TXT records in the record set. + */ + @JsonProperty(value = "properties.txtRecords") + private List txtRecords; + + /** + * Get the etag property: The ETag of the record set. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The ETag of the record set. + * + * @param etag the etag value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the metadata property: The metadata attached to the record set. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata attached to the record set. + * + * @param metadata the metadata value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the ttl property: The TTL (time-to-live) of the records in the record set. + * + * @return the ttl value. + */ + public Long ttl() { + return this.ttl; + } + + /** + * Set the ttl property: The TTL (time-to-live) of the records in the record set. + * + * @param ttl the ttl value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withTtl(Long ttl) { + this.ttl = ttl; + return this; + } + + /** + * Get the fqdn property: Fully qualified domain name of the record set. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the isAutoRegistered property: Is the record set auto-registered in the Private DNS zone through a virtual + * network link?. + * + * @return the isAutoRegistered value. + */ + public Boolean isAutoRegistered() { + return this.isAutoRegistered; + } + + /** + * Get the aRecords property: The list of A records in the record set. + * + * @return the aRecords value. + */ + public List aRecords() { + return this.aRecords; + } + + /** + * Set the aRecords property: The list of A records in the record set. + * + * @param aRecords the aRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withARecords(List aRecords) { + this.aRecords = aRecords; + return this; + } + + /** + * Get the aaaaRecords property: The list of AAAA records in the record set. + * + * @return the aaaaRecords value. + */ + public List aaaaRecords() { + return this.aaaaRecords; + } + + /** + * Set the aaaaRecords property: The list of AAAA records in the record set. + * + * @param aaaaRecords the aaaaRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withAaaaRecords(List aaaaRecords) { + this.aaaaRecords = aaaaRecords; + return this; + } + + /** + * Get the cnameRecord property: The CNAME record in the record set. + * + * @return the cnameRecord value. + */ + public CnameRecord cnameRecord() { + return this.cnameRecord; + } + + /** + * Set the cnameRecord property: The CNAME record in the record set. + * + * @param cnameRecord the cnameRecord value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withCnameRecord(CnameRecord cnameRecord) { + this.cnameRecord = cnameRecord; + return this; + } + + /** + * Get the mxRecords property: The list of MX records in the record set. + * + * @return the mxRecords value. + */ + public List mxRecords() { + return this.mxRecords; + } + + /** + * Set the mxRecords property: The list of MX records in the record set. + * + * @param mxRecords the mxRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withMxRecords(List mxRecords) { + this.mxRecords = mxRecords; + return this; + } + + /** + * Get the ptrRecords property: The list of PTR records in the record set. + * + * @return the ptrRecords value. + */ + public List ptrRecords() { + return this.ptrRecords; + } + + /** + * Set the ptrRecords property: The list of PTR records in the record set. + * + * @param ptrRecords the ptrRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withPtrRecords(List ptrRecords) { + this.ptrRecords = ptrRecords; + return this; + } + + /** + * Get the soaRecord property: The SOA record in the record set. + * + * @return the soaRecord value. + */ + public SoaRecord soaRecord() { + return this.soaRecord; + } + + /** + * Set the soaRecord property: The SOA record in the record set. + * + * @param soaRecord the soaRecord value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withSoaRecord(SoaRecord soaRecord) { + this.soaRecord = soaRecord; + return this; + } + + /** + * Get the srvRecords property: The list of SRV records in the record set. + * + * @return the srvRecords value. + */ + public List srvRecords() { + return this.srvRecords; + } + + /** + * Set the srvRecords property: The list of SRV records in the record set. + * + * @param srvRecords the srvRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withSrvRecords(List srvRecords) { + this.srvRecords = srvRecords; + return this; + } + + /** + * Get the txtRecords property: The list of TXT records in the record set. + * + * @return the txtRecords value. + */ + public List txtRecords() { + return this.txtRecords; + } + + /** + * Set the txtRecords property: The list of TXT records in the record set. + * + * @param txtRecords the txtRecords value to set. + * @return the RecordSetInner object itself. + */ + public RecordSetInner withTxtRecords(List txtRecords) { + this.txtRecords = txtRecords; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aRecords() != null) { + aRecords().forEach(e -> e.validate()); + } + if (aaaaRecords() != null) { + aaaaRecords().forEach(e -> e.validate()); + } + if (cnameRecord() != null) { + cnameRecord().validate(); + } + if (mxRecords() != null) { + mxRecords().forEach(e -> e.validate()); + } + if (ptrRecords() != null) { + ptrRecords().forEach(e -> e.validate()); + } + if (soaRecord() != null) { + soaRecord().validate(); + } + if (srvRecords() != null) { + srvRecords().forEach(e -> e.validate()); + } + if (txtRecords() != null) { + txtRecords().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/VirtualNetworkLinkInner.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/VirtualNetworkLinkInner.java new file mode 100644 index 0000000000000..60f9aabe42c3e --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/VirtualNetworkLinkInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.models.ProvisioningState; +import com.azure.resourcemanager.privatedns.generated.models.VirtualNetworkLinkState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a link to virtual network for a Private DNS zone. */ +@JsonFlatten +@Fluent +public class VirtualNetworkLinkInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkLinkInner.class); + + /* + * The ETag of the virtual network link. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The reference of the virtual network. + */ + @JsonProperty(value = "properties.virtualNetwork") + private SubResource virtualNetwork; + + /* + * Is auto-registration of virtual machine records in the virtual network + * in the Private DNS zone enabled? + */ + @JsonProperty(value = "properties.registrationEnabled") + private Boolean registrationEnabled; + + /* + * The status of the virtual network link to the Private DNS zone. Possible + * values are 'InProgress' and 'Done'. This is a read-only property and any + * attempt to set this value will be ignored. + */ + @JsonProperty(value = "properties.virtualNetworkLinkState", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkLinkState virtualNetworkLinkState; + + /* + * The provisioning state of the resource. This is a read-only property and + * any attempt to set this value will be ignored. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the etag property: The ETag of the virtual network link. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The ETag of the virtual network link. + * + * @param etag the etag value to set. + * @return the VirtualNetworkLinkInner object itself. + */ + public VirtualNetworkLinkInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the virtualNetwork property: The reference of the virtual network. + * + * @return the virtualNetwork value. + */ + public SubResource virtualNetwork() { + return this.virtualNetwork; + } + + /** + * Set the virtualNetwork property: The reference of the virtual network. + * + * @param virtualNetwork the virtualNetwork value to set. + * @return the VirtualNetworkLinkInner object itself. + */ + public VirtualNetworkLinkInner withVirtualNetwork(SubResource virtualNetwork) { + this.virtualNetwork = virtualNetwork; + return this; + } + + /** + * Get the registrationEnabled property: Is auto-registration of virtual machine records in the virtual network in + * the Private DNS zone enabled?. + * + * @return the registrationEnabled value. + */ + public Boolean registrationEnabled() { + return this.registrationEnabled; + } + + /** + * Set the registrationEnabled property: Is auto-registration of virtual machine records in the virtual network in + * the Private DNS zone enabled?. + * + * @param registrationEnabled the registrationEnabled value to set. + * @return the VirtualNetworkLinkInner object itself. + */ + public VirtualNetworkLinkInner withRegistrationEnabled(Boolean registrationEnabled) { + this.registrationEnabled = registrationEnabled; + return this; + } + + /** + * Get the virtualNetworkLinkState property: The status of the virtual network link to the Private DNS zone. + * Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will + * be ignored. + * + * @return the virtualNetworkLinkState value. + */ + public VirtualNetworkLinkState virtualNetworkLinkState() { + return this.virtualNetworkLinkState; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. This is a read-only property and any + * attempt to set this value will be ignored. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkLinkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkLinkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/package-info.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..1e8e016f42071 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for PrivateDnsManagementClient. The Private DNS Management Client. */ +package com.azure.resourcemanager.privatedns.generated.fluent.models; diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/package-info.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/package-info.java new file mode 100644 index 0000000000000..98af7fc428d1f --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for PrivateDnsManagementClient. The Private DNS Management Client. */ +package com.azure.resourcemanager.privatedns.generated.fluent; diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateDnsManagementClientBuilder.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateDnsManagementClientBuilder.java new file mode 100644 index 0000000000000..fd18cf08e4196 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateDnsManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the PrivateDnsManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {PrivateDnsManagementClientImpl.class}) +public final class PrivateDnsManagementClientBuilder { + /* + * Gets subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the PrivateDnsManagementClientBuilder. + */ + public PrivateDnsManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the PrivateDnsManagementClientBuilder. + */ + public PrivateDnsManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the PrivateDnsManagementClientBuilder. + */ + public PrivateDnsManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the PrivateDnsManagementClientBuilder. + */ + public PrivateDnsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the PrivateDnsManagementClientBuilder. + */ + public PrivateDnsManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the PrivateDnsManagementClientBuilder. + */ + public PrivateDnsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of PrivateDnsManagementClientImpl with the provided parameters. + * + * @return an instance of PrivateDnsManagementClientImpl. + */ + public PrivateDnsManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + PrivateDnsManagementClientImpl client = + new PrivateDnsManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateDnsManagementClientImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateDnsManagementClientImpl.java new file mode 100644 index 0000000000000..b78e3d268ab96 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateDnsManagementClientImpl.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.privatedns.generated.fluent.PrivateDnsManagementClient; +import com.azure.resourcemanager.privatedns.generated.fluent.PrivateZonesClient; +import com.azure.resourcemanager.privatedns.generated.fluent.RecordSetsClient; +import com.azure.resourcemanager.privatedns.generated.fluent.VirtualNetworkLinksClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the PrivateDnsManagementClientImpl type. */ +@ServiceClient(builder = PrivateDnsManagementClientBuilder.class) +public final class PrivateDnsManagementClientImpl implements PrivateDnsManagementClient { + private final ClientLogger logger = new ClientLogger(PrivateDnsManagementClientImpl.class); + + /** + * Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The PrivateZonesClient object to access its operations. */ + private final PrivateZonesClient privateZones; + + /** + * Gets the PrivateZonesClient object to access its operations. + * + * @return the PrivateZonesClient object. + */ + public PrivateZonesClient getPrivateZones() { + return this.privateZones; + } + + /** The VirtualNetworkLinksClient object to access its operations. */ + private final VirtualNetworkLinksClient virtualNetworkLinks; + + /** + * Gets the VirtualNetworkLinksClient object to access its operations. + * + * @return the VirtualNetworkLinksClient object. + */ + public VirtualNetworkLinksClient getVirtualNetworkLinks() { + return this.virtualNetworkLinks; + } + + /** The RecordSetsClient object to access its operations. */ + private final RecordSetsClient recordSets; + + /** + * Gets the RecordSetsClient object to access its operations. + * + * @return the RecordSetsClient object. + */ + public RecordSetsClient getRecordSets() { + return this.recordSets; + } + + /** + * Initializes an instance of PrivateDnsManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Gets subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + PrivateDnsManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-06-01"; + this.privateZones = new PrivateZonesClientImpl(this); + this.virtualNetworkLinks = new VirtualNetworkLinksClientImpl(this); + this.recordSets = new RecordSetsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZoneImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZoneImpl.java new file mode 100644 index 0000000000000..9e699cdc4b627 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZoneImpl.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.privatedns.generated.fluent.models.PrivateZoneInner; +import com.azure.resourcemanager.privatedns.generated.models.PrivateZone; +import com.azure.resourcemanager.privatedns.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class PrivateZoneImpl implements PrivateZone, PrivateZone.Definition, PrivateZone.Update { + private PrivateZoneInner innerObject; + + private final com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Long maxNumberOfRecordSets() { + return this.innerModel().maxNumberOfRecordSets(); + } + + public Long numberOfRecordSets() { + return this.innerModel().numberOfRecordSets(); + } + + public Long maxNumberOfVirtualNetworkLinks() { + return this.innerModel().maxNumberOfVirtualNetworkLinks(); + } + + public Long numberOfVirtualNetworkLinks() { + return this.innerModel().numberOfVirtualNetworkLinks(); + } + + public Long maxNumberOfVirtualNetworkLinksWithRegistration() { + return this.innerModel().maxNumberOfVirtualNetworkLinksWithRegistration(); + } + + public Long numberOfVirtualNetworkLinksWithRegistration() { + return this.innerModel().numberOfVirtualNetworkLinksWithRegistration(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String internalId() { + return this.innerModel().internalId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PrivateZoneInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.privatedns.generated.PrivateDnsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateZoneName; + + private String createIfMatch; + + private String createIfNoneMatch; + + private String updateIfMatch; + + public PrivateZoneImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PrivateZone create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateZones() + .createOrUpdate( + resourceGroupName, + privateZoneName, + this.innerModel(), + createIfMatch, + createIfNoneMatch, + Context.NONE); + return this; + } + + public PrivateZone create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateZones() + .createOrUpdate( + resourceGroupName, privateZoneName, this.innerModel(), createIfMatch, createIfNoneMatch, context); + return this; + } + + PrivateZoneImpl(String name, com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager) { + this.innerObject = new PrivateZoneInner(); + this.serviceManager = serviceManager; + this.privateZoneName = name; + this.createIfMatch = null; + this.createIfNoneMatch = null; + } + + public PrivateZoneImpl update() { + this.updateIfMatch = null; + return this; + } + + public PrivateZone apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateZones() + .update(resourceGroupName, privateZoneName, this.innerModel(), updateIfMatch, Context.NONE); + return this; + } + + public PrivateZone apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateZones() + .update(resourceGroupName, privateZoneName, this.innerModel(), updateIfMatch, context); + return this; + } + + PrivateZoneImpl( + PrivateZoneInner innerObject, com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateZoneName = Utils.getValueFromIdByName(innerObject.id(), "privateDnsZones"); + } + + public PrivateZone refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateZones() + .getByResourceGroupWithResponse(resourceGroupName, privateZoneName, Context.NONE) + .getValue(); + return this; + } + + public PrivateZone refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateZones() + .getByResourceGroupWithResponse(resourceGroupName, privateZoneName, context) + .getValue(); + return this; + } + + public PrivateZoneImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateZoneImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateZoneImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public PrivateZoneImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public PrivateZoneImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + public PrivateZoneImpl withIfNoneMatch(String ifNoneMatch) { + this.createIfNoneMatch = ifNoneMatch; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZonesClientImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZonesClientImpl.java new file mode 100644 index 0000000000000..d5f736a9d3a25 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZonesClientImpl.java @@ -0,0 +1,1880 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.privatedns.generated.fluent.PrivateZonesClient; +import com.azure.resourcemanager.privatedns.generated.fluent.models.PrivateZoneInner; +import com.azure.resourcemanager.privatedns.generated.models.PrivateZoneListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateZonesClient. */ +public final class PrivateZonesClientImpl implements PrivateZonesClient { + private final ClientLogger logger = new ClientLogger(PrivateZonesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateZonesService service; + + /** The service client containing this operation class. */ + private final PrivateDnsManagementClientImpl client; + + /** + * Initializes an instance of PrivateZonesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateZonesClientImpl(PrivateDnsManagementClientImpl client) { + this.service = + RestProxy.create(PrivateZonesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateDnsManagementClientPrivateZones to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateDnsManagement") + private interface PrivateZonesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateZoneInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateZoneInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateDnsZones") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateZoneInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateZoneInner.class, PrivateZoneInner.class, Context.NONE); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateZoneInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateZoneInner.class, PrivateZoneInner.class, context); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateZoneInner> beginCreateOrUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch) + .getSyncPoller(); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateZoneInner> beginCreateOrUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch, context) + .getSyncPoller(); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateZoneInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch) { + return createOrUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch).block(); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateZoneInner createOrUpdate( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch).block(); + } + + /** + * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an existing + * zone. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateZoneInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return createOrUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch, context) + .block(); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateZoneInner> beginUpdateAsync( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateZoneInner.class, PrivateZoneInner.class, Context.NONE); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateZoneInner> beginUpdateAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateZoneInner.class, PrivateZoneInner.class, context); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateZoneInner> beginUpdate( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + return beginUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch).getSyncPoller(); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateZoneInner> beginUpdate( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + Context context) { + return beginUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, context).getSyncPoller(); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + return beginUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + final String ifMatch = null; + return beginUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + Context context) { + return beginUpdateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateZoneInner update( + String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + return updateAsync(resourceGroupName, privateZoneName, parameters, ifMatch).block(); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateZoneInner update(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + final String ifMatch = null; + return updateAsync(resourceGroupName, privateZoneName, parameters, ifMatch).block(); + } + + /** + * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateZoneInner update( + String resourceGroupName, + String privateZoneName, + PrivateZoneInner parameters, + String ifMatch, + Context context) { + return updateAsync(resourceGroupName, privateZoneName, parameters, ifMatch, context).block(); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateZoneName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateZoneName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateZoneName, String ifMatch) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateZoneName, ifMatch); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateZoneName, String ifMatch, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateZoneName, ifMatch, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateZoneName, String ifMatch) { + return beginDeleteAsync(resourceGroupName, privateZoneName, ifMatch).getSyncPoller(); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateZoneName, String ifMatch, Context context) { + return beginDeleteAsync(resourceGroupName, privateZoneName, ifMatch, context).getSyncPoller(); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateZoneName, String ifMatch) { + return beginDeleteAsync(resourceGroupName, privateZoneName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateZoneName) { + final String ifMatch = null; + return beginDeleteAsync(resourceGroupName, privateZoneName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateZoneName, String ifMatch, Context context) { + return beginDeleteAsync(resourceGroupName, privateZoneName, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateZoneName, String ifMatch) { + deleteAsync(resourceGroupName, privateZoneName, ifMatch).block(); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateZoneName) { + final String ifMatch = null; + deleteAsync(resourceGroupName, privateZoneName, ifMatch).block(); + } + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateZoneName, String ifMatch, Context context) { + deleteAsync(resourceGroupName, privateZoneName, ifMatch, context).block(); + } + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String privateZoneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String privateZoneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String privateZoneName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateZoneName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateZoneInner getByResourceGroup(String resourceGroupName, String privateZoneName) { + return getByResourceGroupAsync(resourceGroupName, privateZoneName).block(); + } + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateZoneName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateZoneName, context).block(); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(top, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer top = null; + return new PagedIterable<>(listAsync(top)); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer top, Context context) { + return new PagedIterable<>(listAsync(top, context)); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top)); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZonesImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZonesImpl.java new file mode 100644 index 0000000000000..2256a88e3a1d0 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/PrivateZonesImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.fluent.PrivateZonesClient; +import com.azure.resourcemanager.privatedns.generated.fluent.models.PrivateZoneInner; +import com.azure.resourcemanager.privatedns.generated.models.PrivateZone; +import com.azure.resourcemanager.privatedns.generated.models.PrivateZones; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateZonesImpl implements PrivateZones { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateZonesImpl.class); + + private final PrivateZonesClient innerClient; + + private final com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager; + + public PrivateZonesImpl( + PrivateZonesClient innerClient, + com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String privateZoneName, String ifMatch) { + this.serviceClient().delete(resourceGroupName, privateZoneName, ifMatch); + } + + public void delete(String resourceGroupName, String privateZoneName) { + this.serviceClient().delete(resourceGroupName, privateZoneName); + } + + public void delete(String resourceGroupName, String privateZoneName, String ifMatch, Context context) { + this.serviceClient().delete(resourceGroupName, privateZoneName, ifMatch, context); + } + + public PrivateZone getByResourceGroup(String resourceGroupName, String privateZoneName) { + PrivateZoneInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, privateZoneName); + if (inner != null) { + return new PrivateZoneImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateZoneName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, privateZoneName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateZoneImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateZoneImpl(inner1, this.manager())); + } + + public PagedIterable list(Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(top, context); + return Utils.mapPage(inner, inner1 -> new PrivateZoneImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateZoneImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, top, context); + return Utils.mapPage(inner, inner1 -> new PrivateZoneImpl(inner1, this.manager())); + } + + public PrivateZone getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateZoneName = Utils.getValueFromIdByName(id, "privateDnsZones"); + if (privateZoneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateDnsZones'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateZoneName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateZoneName = Utils.getValueFromIdByName(id, "privateDnsZones"); + if (privateZoneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateDnsZones'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateZoneName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateZoneName = Utils.getValueFromIdByName(id, "privateDnsZones"); + if (privateZoneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateDnsZones'.", id))); + } + String localIfMatch = null; + this.delete(resourceGroupName, privateZoneName, localIfMatch, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateZoneName = Utils.getValueFromIdByName(id, "privateDnsZones"); + if (privateZoneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateDnsZones'.", id))); + } + this.delete(resourceGroupName, privateZoneName, ifMatch, context); + } + + private PrivateZonesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.privatedns.generated.PrivateDnsManager manager() { + return this.serviceManager; + } + + public PrivateZoneImpl define(String name) { + return new PrivateZoneImpl(name, this.manager()); + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetImpl.java new file mode 100644 index 0000000000000..ecbe33fc7b15f --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.resourcemanager.privatedns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.privatedns.generated.models.ARecord; +import com.azure.resourcemanager.privatedns.generated.models.AaaaRecord; +import com.azure.resourcemanager.privatedns.generated.models.CnameRecord; +import com.azure.resourcemanager.privatedns.generated.models.MxRecord; +import com.azure.resourcemanager.privatedns.generated.models.PtrRecord; +import com.azure.resourcemanager.privatedns.generated.models.RecordSet; +import com.azure.resourcemanager.privatedns.generated.models.SoaRecord; +import com.azure.resourcemanager.privatedns.generated.models.SrvRecord; +import com.azure.resourcemanager.privatedns.generated.models.TxtRecord; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class RecordSetImpl implements RecordSet { + private RecordSetInner innerObject; + + private final com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager; + + RecordSetImpl( + RecordSetInner innerObject, com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Long ttl() { + return this.innerModel().ttl(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public Boolean isAutoRegistered() { + return this.innerModel().isAutoRegistered(); + } + + public List aRecords() { + List inner = this.innerModel().aRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List aaaaRecords() { + List inner = this.innerModel().aaaaRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CnameRecord cnameRecord() { + return this.innerModel().cnameRecord(); + } + + public List mxRecords() { + List inner = this.innerModel().mxRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List ptrRecords() { + List inner = this.innerModel().ptrRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SoaRecord soaRecord() { + return this.innerModel().soaRecord(); + } + + public List srvRecords() { + List inner = this.innerModel().srvRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List txtRecords() { + List inner = this.innerModel().txtRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RecordSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.privatedns.generated.PrivateDnsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetsClientImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetsClientImpl.java new file mode 100644 index 0000000000000..2955f3f47a7ed --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetsClientImpl.java @@ -0,0 +1,1844 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.fluent.RecordSetsClient; +import com.azure.resourcemanager.privatedns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.privatedns.generated.models.RecordSetListResult; +import com.azure.resourcemanager.privatedns.generated.models.RecordType; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RecordSetsClient. */ +public final class RecordSetsClientImpl implements RecordSetsClient { + private final ClientLogger logger = new ClientLogger(RecordSetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RecordSetsService service; + + /** The service client containing this operation class. */ + private final PrivateDnsManagementClientImpl client; + + /** + * Initializes an instance of RecordSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecordSetsClientImpl(PrivateDnsManagementClientImpl client) { + this.service = + RestProxy.create(RecordSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateDnsManagementClientRecordSets to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateDnsManagement") + private interface RecordSetsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("recordType") RecordType recordType, + @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RecordSetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("recordType") RecordType recordType, + @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RecordSetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("recordType") RecordType recordType, + @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("recordType") RecordType recordType, + @PathParam(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/{recordType}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByType( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("recordType") RecordType recordType, + @QueryParam("$top") Integer top, + @QueryParam("$recordsetnamesuffix") String recordsetnamesuffix, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/ALL") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @QueryParam("$top") Integer top, + @QueryParam("$recordsetnamesuffix") String recordsetnamesuffix, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTypeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch) { + return createOrUpdateWithResponseAsync( + resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecordSetInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateAsync( + resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch) + .block(); + } + + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + parameters, + ifMatch, + ifNoneMatch, + context) + .block(); + } + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch) { + return updateWithResponseAsync( + resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters) { + final String ifMatch = null; + return updateWithResponseAsync( + resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecordSetInner update( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters) { + final String ifMatch = null; + return updateAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch) + .block(); + } + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + Context context) { + return updateWithResponseAsync( + resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param ifMatch The ETag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param ifMatch The ETag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param ifMatch The ETag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + final String ifMatch = null; + return deleteWithResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + final String ifMatch = null; + deleteAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, ifMatch).block(); + } + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param ifMatch The ETag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + String ifMatch, + Context context) { + return deleteWithResponseAsync( + resourceGroupName, privateZoneName, recordType, relativeRecordSetName, ifMatch, context) + .block(); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (relativeRecordSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + return getWithResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecordSetInner get( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + return getAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName).block(); + } + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + Context context) { + return getWithResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, context) + .block(); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTypeSinglePageAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByType( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + top, + recordsetnamesuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTypeSinglePageAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (recordType == null) { + return Mono.error(new IllegalArgumentException("Parameter recordType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByType( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + recordType, + top, + recordsetnamesuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTypeAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix) { + return new PagedFlux<>( + () -> listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix), + nextLink -> listByTypeNextSinglePageAsync(nextLink)); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTypeAsync( + String resourceGroupName, String privateZoneName, RecordType recordType) { + final Integer top = null; + final String recordsetnamesuffix = null; + return new PagedFlux<>( + () -> listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix), + nextLink -> listByTypeNextSinglePageAsync(nextLink)); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTypeAsync( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context) { + return new PagedFlux<>( + () -> + listByTypeSinglePageAsync( + resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix, context), + nextLink -> listByTypeNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByType( + String resourceGroupName, String privateZoneName, RecordType recordType) { + final Integer top = null; + final String recordsetnamesuffix = null; + return new PagedIterable<>( + listByTypeAsync(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix)); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByType( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context) { + return new PagedIterable<>( + listByTypeAsync(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix, context)); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateZoneName, Integer top, String recordsetnamesuffix) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + top, + recordsetnamesuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateZoneName, Integer top, String recordsetnamesuffix, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + top, + recordsetnamesuffix, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateZoneName, Integer top, String recordsetnamesuffix) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateZoneName) { + final Integer top = null; + final String recordsetnamesuffix = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateZoneName, Integer top, String recordsetnamesuffix, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateZoneName) { + final Integer top = null; + final String recordsetnamesuffix = null; + return new PagedIterable<>(listAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix)); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateZoneName, Integer top, String recordsetnamesuffix, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTypeNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByTypeNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTypeNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTypeNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetsImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetsImpl.java new file mode 100644 index 0000000000000..2fc9a1657bec7 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/RecordSetsImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.fluent.RecordSetsClient; +import com.azure.resourcemanager.privatedns.generated.fluent.models.RecordSetInner; +import com.azure.resourcemanager.privatedns.generated.models.RecordSet; +import com.azure.resourcemanager.privatedns.generated.models.RecordSets; +import com.azure.resourcemanager.privatedns.generated.models.RecordType; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RecordSetsImpl implements RecordSets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecordSetsImpl.class); + + private final RecordSetsClient innerClient; + + private final com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager; + + public RecordSetsImpl( + RecordSetsClient innerClient, com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public RecordSet createOrUpdate( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters) { + RecordSetInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters); + if (inner != null) { + return new RecordSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + parameters, + ifMatch, + ifNoneMatch, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecordSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecordSet update( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters) { + RecordSetInner inner = + this + .serviceClient() + .update(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters); + if (inner != null) { + return new RecordSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse( + resourceGroupName, + privateZoneName, + recordType, + relativeRecordSetName, + parameters, + ifMatch, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecordSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + this.serviceClient().delete(resourceGroupName, privateZoneName, recordType, relativeRecordSetName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse( + resourceGroupName, privateZoneName, recordType, relativeRecordSetName, ifMatch, context); + } + + public RecordSet get( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + RecordSetInner inner = + this.serviceClient().get(resourceGroupName, privateZoneName, recordType, relativeRecordSetName); + if (inner != null) { + return new RecordSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecordSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByType( + String resourceGroupName, String privateZoneName, RecordType recordType) { + PagedIterable inner = + this.serviceClient().listByType(resourceGroupName, privateZoneName, recordType); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + public PagedIterable listByType( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByType(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix, context); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateZoneName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateZoneName); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateZoneName, Integer top, String recordsetnamesuffix, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateZoneName, top, recordsetnamesuffix, context); + return Utils.mapPage(inner, inner1 -> new RecordSetImpl(inner1, this.manager())); + } + + private RecordSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.privatedns.generated.PrivateDnsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/Utils.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/Utils.java new file mode 100644 index 0000000000000..bd634bb917bfa --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinkImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinkImpl.java new file mode 100644 index 0000000000000..091805ee787cd --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinkImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.privatedns.generated.fluent.models.VirtualNetworkLinkInner; +import com.azure.resourcemanager.privatedns.generated.models.ProvisioningState; +import com.azure.resourcemanager.privatedns.generated.models.VirtualNetworkLink; +import com.azure.resourcemanager.privatedns.generated.models.VirtualNetworkLinkState; +import java.util.Collections; +import java.util.Map; + +public final class VirtualNetworkLinkImpl + implements VirtualNetworkLink, VirtualNetworkLink.Definition, VirtualNetworkLink.Update { + private VirtualNetworkLinkInner innerObject; + + private final com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public SubResource virtualNetwork() { + return this.innerModel().virtualNetwork(); + } + + public Boolean registrationEnabled() { + return this.innerModel().registrationEnabled(); + } + + public VirtualNetworkLinkState virtualNetworkLinkState() { + return this.innerModel().virtualNetworkLinkState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualNetworkLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.privatedns.generated.PrivateDnsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateZoneName; + + private String virtualNetworkLinkName; + + private String createIfMatch; + + private String createIfNoneMatch; + + private String updateIfMatch; + + public VirtualNetworkLinkImpl withExistingPrivateDnsZone(String resourceGroupName, String privateZoneName) { + this.resourceGroupName = resourceGroupName; + this.privateZoneName = privateZoneName; + return this; + } + + public VirtualNetworkLink create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkLinks() + .createOrUpdate( + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + this.innerModel(), + createIfMatch, + createIfNoneMatch, + Context.NONE); + return this; + } + + public VirtualNetworkLink create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkLinks() + .createOrUpdate( + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + this.innerModel(), + createIfMatch, + createIfNoneMatch, + context); + return this; + } + + VirtualNetworkLinkImpl( + String name, com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager) { + this.innerObject = new VirtualNetworkLinkInner(); + this.serviceManager = serviceManager; + this.virtualNetworkLinkName = name; + this.createIfMatch = null; + this.createIfNoneMatch = null; + } + + public VirtualNetworkLinkImpl update() { + this.updateIfMatch = null; + return this; + } + + public VirtualNetworkLink apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkLinks() + .update( + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + this.innerModel(), + updateIfMatch, + Context.NONE); + return this; + } + + public VirtualNetworkLink apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkLinks() + .update( + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + this.innerModel(), + updateIfMatch, + context); + return this; + } + + VirtualNetworkLinkImpl( + VirtualNetworkLinkInner innerObject, + com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateZoneName = Utils.getValueFromIdByName(innerObject.id(), "privateDnsZones"); + this.virtualNetworkLinkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkLinks"); + } + + public VirtualNetworkLink refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkLinks() + .getWithResponse(resourceGroupName, privateZoneName, virtualNetworkLinkName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkLink refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkLinks() + .getWithResponse(resourceGroupName, privateZoneName, virtualNetworkLinkName, context) + .getValue(); + return this; + } + + public VirtualNetworkLinkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkLinkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkLinkImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public VirtualNetworkLinkImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public VirtualNetworkLinkImpl withVirtualNetwork(SubResource virtualNetwork) { + this.innerModel().withVirtualNetwork(virtualNetwork); + return this; + } + + public VirtualNetworkLinkImpl withRegistrationEnabled(Boolean registrationEnabled) { + this.innerModel().withRegistrationEnabled(registrationEnabled); + return this; + } + + public VirtualNetworkLinkImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + public VirtualNetworkLinkImpl withIfNoneMatch(String ifNoneMatch) { + this.createIfNoneMatch = ifNoneMatch; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinksClientImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinksClientImpl.java new file mode 100644 index 0000000000000..5a8a38ac72082 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinksClientImpl.java @@ -0,0 +1,1876 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.privatedns.generated.fluent.VirtualNetworkLinksClient; +import com.azure.resourcemanager.privatedns.generated.fluent.models.VirtualNetworkLinkInner; +import com.azure.resourcemanager.privatedns.generated.models.VirtualNetworkLinkListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkLinksClient. */ +public final class VirtualNetworkLinksClientImpl implements VirtualNetworkLinksClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkLinksService service; + + /** The service client containing this operation class. */ + private final PrivateDnsManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkLinksClientImpl(PrivateDnsManagementClientImpl client) { + this.service = + RestProxy.create(VirtualNetworkLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateDnsManagementClientVirtualNetworkLinks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateDnsManagement") + private interface VirtualNetworkLinksService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("virtualNetworkLinkName") String virtualNetworkLinkName, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkLinkInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("virtualNetworkLinkName") String virtualNetworkLinkName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkLinkInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("virtualNetworkLinkName") String virtualNetworkLinkName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @PathParam("virtualNetworkLinkName") String virtualNetworkLinkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateDnsZones/{privateZoneName}/virtualNetworkLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateZoneName") String privateZoneName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (virtualNetworkLinkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (virtualNetworkLinkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + ifMatch, + ifNoneMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkLinkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkLinkInner.class, + VirtualNetworkLinkInner.class, + Context.NONE); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkLinkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkLinkInner.class, + VirtualNetworkLinkInner.class, + context); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkLinkInner> beginCreateOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch) + .getSyncPoller(); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkLinkInner> beginCreateOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch, context) + .getSyncPoller(); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkLinkInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch) { + return createOrUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch) + .block(); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkLinkInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch) + .block(); + } + + /** + * Creates or updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, but to + * prevent updating an existing link. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkLinkInner createOrUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return createOrUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch, context) + .block(); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (virtualNetworkLinkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (virtualNetworkLinkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkLinkInner> beginUpdateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkLinkInner.class, + VirtualNetworkLinkInner.class, + Context.NONE); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualNetworkLinkInner> beginUpdateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkLinkInner.class, + VirtualNetworkLinkInner.class, + context); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkLinkInner> beginUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch) { + return beginUpdateAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch) + .getSyncPoller(); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualNetworkLinkInner> beginUpdate( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + Context context) { + return beginUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, context) + .getSyncPoller(); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch) { + return beginUpdateAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters) { + final String ifMatch = null; + return beginUpdateAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + Context context) { + return beginUpdateAsync( + resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkLinkInner update( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch) { + return updateAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch).block(); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkLinkInner update( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters) { + final String ifMatch = null; + return updateAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch).block(); + } + + /** + * Updates a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always overwrite + * the current virtual network link. Specify the last-seen ETag value to prevent accidentally overwriting any + * concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a link to virtual network for a Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkLinkInner update( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + VirtualNetworkLinkInner parameters, + String ifMatch, + Context context) { + return updateAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (virtualNetworkLinkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (virtualNetworkLinkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + return beginDeleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch).getSyncPoller(); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context) { + return beginDeleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch, context) + .getSyncPoller(); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + return beginDeleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + final String ifMatch = null; + return beginDeleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context) { + return beginDeleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + deleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch).block(); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + final String ifMatch = null; + deleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch).block(); + } + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context) { + deleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch, context).block(); + } + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (virtualNetworkLinkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (virtualNetworkLinkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + virtualNetworkLinkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + return getWithResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkLinkInner get( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + return getAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName).block(); + } + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, Context context) { + return getWithResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, context).block(); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of virtual network links to return. If not specified, returns up to 100 virtual + * network links. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateZoneName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of virtual network links to return. If not specified, returns up to 100 virtual + * network links. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateZoneName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + privateZoneName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of virtual network links to return. If not specified, returns up to 100 virtual + * network links. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateZoneName, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateZoneName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateZoneName) { + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateZoneName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of virtual network links to return. If not specified, returns up to 100 virtual + * network links. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateZoneName, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateZoneName, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateZoneName) { + final Integer top = null; + return new PagedIterable<>(listAsync(resourceGroupName, privateZoneName, top)); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of virtual network links to return. If not specified, returns up to 100 virtual + * network links. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateZoneName, Integer top, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateZoneName, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinksImpl.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinksImpl.java new file mode 100644 index 0000000000000..a2e72feca1271 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/VirtualNetworkLinksImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.fluent.VirtualNetworkLinksClient; +import com.azure.resourcemanager.privatedns.generated.fluent.models.VirtualNetworkLinkInner; +import com.azure.resourcemanager.privatedns.generated.models.VirtualNetworkLink; +import com.azure.resourcemanager.privatedns.generated.models.VirtualNetworkLinks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkLinksImpl implements VirtualNetworkLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkLinksImpl.class); + + private final VirtualNetworkLinksClient innerClient; + + private final com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager; + + public VirtualNetworkLinksImpl( + VirtualNetworkLinksClient innerClient, + com.azure.resourcemanager.privatedns.generated.PrivateDnsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + this.serviceClient().delete(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch); + } + + public void delete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + this.serviceClient().delete(resourceGroupName, privateZoneName, virtualNetworkLinkName); + } + + public void delete( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context) { + this.serviceClient().delete(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch, context); + } + + public VirtualNetworkLink get(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + VirtualNetworkLinkInner inner = + this.serviceClient().get(resourceGroupName, privateZoneName, virtualNetworkLinkName); + if (inner != null) { + return new VirtualNetworkLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateZoneName, virtualNetworkLinkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkLinkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String privateZoneName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateZoneName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkLinkImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateZoneName, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateZoneName, top, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkLinkImpl(inner1, this.manager())); + } + + public VirtualNetworkLink getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateZoneName = Utils.getValueFromIdByName(id, "privateDnsZones"); + if (privateZoneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateDnsZones'.", id))); + } + String virtualNetworkLinkName = Utils.getValueFromIdByName(id, "virtualNetworkLinks"); + if (virtualNetworkLinkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkLinks'.", id))); + } + return this + .getWithResponse(resourceGroupName, privateZoneName, virtualNetworkLinkName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateZoneName = Utils.getValueFromIdByName(id, "privateDnsZones"); + if (privateZoneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateDnsZones'.", id))); + } + String virtualNetworkLinkName = Utils.getValueFromIdByName(id, "virtualNetworkLinks"); + if (virtualNetworkLinkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkLinks'.", id))); + } + return this.getWithResponse(resourceGroupName, privateZoneName, virtualNetworkLinkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateZoneName = Utils.getValueFromIdByName(id, "privateDnsZones"); + if (privateZoneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateDnsZones'.", id))); + } + String virtualNetworkLinkName = Utils.getValueFromIdByName(id, "virtualNetworkLinks"); + if (virtualNetworkLinkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkLinks'.", id))); + } + String localIfMatch = null; + this.delete(resourceGroupName, privateZoneName, virtualNetworkLinkName, localIfMatch, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateZoneName = Utils.getValueFromIdByName(id, "privateDnsZones"); + if (privateZoneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateDnsZones'.", id))); + } + String virtualNetworkLinkName = Utils.getValueFromIdByName(id, "virtualNetworkLinks"); + if (virtualNetworkLinkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkLinks'.", id))); + } + this.delete(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch, context); + } + + private VirtualNetworkLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.privatedns.generated.PrivateDnsManager manager() { + return this.serviceManager; + } + + public VirtualNetworkLinkImpl define(String name) { + return new VirtualNetworkLinkImpl(name, this.manager()); + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/package-info.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/package-info.java new file mode 100644 index 0000000000000..c3b7f3c0156fe --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for PrivateDnsManagementClient. The Private DNS Management Client. */ +package com.azure.resourcemanager.privatedns.generated.implementation; diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/ARecord.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/ARecord.java new file mode 100644 index 0000000000000..68352eb26786f --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/ARecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An A record. */ +@Fluent +public final class ARecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ARecord.class); + + /* + * The IPv4 address of this A record. + */ + @JsonProperty(value = "ipv4Address") + private String ipv4Address; + + /** + * Get the ipv4Address property: The IPv4 address of this A record. + * + * @return the ipv4Address value. + */ + public String ipv4Address() { + return this.ipv4Address; + } + + /** + * Set the ipv4Address property: The IPv4 address of this A record. + * + * @param ipv4Address the ipv4Address value to set. + * @return the ARecord object itself. + */ + public ARecord withIpv4Address(String ipv4Address) { + this.ipv4Address = ipv4Address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/AaaaRecord.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/AaaaRecord.java new file mode 100644 index 0000000000000..9c5c1fbc948af --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/AaaaRecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An AAAA record. */ +@Fluent +public final class AaaaRecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AaaaRecord.class); + + /* + * The IPv6 address of this AAAA record. + */ + @JsonProperty(value = "ipv6Address") + private String ipv6Address; + + /** + * Get the ipv6Address property: The IPv6 address of this AAAA record. + * + * @return the ipv6Address value. + */ + public String ipv6Address() { + return this.ipv6Address; + } + + /** + * Set the ipv6Address property: The IPv6 address of this AAAA record. + * + * @param ipv6Address the ipv6Address value to set. + * @return the AaaaRecord object itself. + */ + public AaaaRecord withIpv6Address(String ipv6Address) { + this.ipv6Address = ipv6Address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/CnameRecord.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/CnameRecord.java new file mode 100644 index 0000000000000..d8cb0927969b3 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/CnameRecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A CNAME record. */ +@Fluent +public final class CnameRecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CnameRecord.class); + + /* + * The canonical name for this CNAME record. + */ + @JsonProperty(value = "cname") + private String cname; + + /** + * Get the cname property: The canonical name for this CNAME record. + * + * @return the cname value. + */ + public String cname() { + return this.cname; + } + + /** + * Set the cname property: The canonical name for this CNAME record. + * + * @param cname the cname value to set. + * @return the CnameRecord object itself. + */ + public CnameRecord withCname(String cname) { + this.cname = cname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/MxRecord.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/MxRecord.java new file mode 100644 index 0000000000000..01208ca8c4362 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/MxRecord.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An MX record. */ +@Fluent +public final class MxRecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MxRecord.class); + + /* + * The preference value for this MX record. + */ + @JsonProperty(value = "preference") + private Integer preference; + + /* + * The domain name of the mail host for this MX record. + */ + @JsonProperty(value = "exchange") + private String exchange; + + /** + * Get the preference property: The preference value for this MX record. + * + * @return the preference value. + */ + public Integer preference() { + return this.preference; + } + + /** + * Set the preference property: The preference value for this MX record. + * + * @param preference the preference value to set. + * @return the MxRecord object itself. + */ + public MxRecord withPreference(Integer preference) { + this.preference = preference; + return this; + } + + /** + * Get the exchange property: The domain name of the mail host for this MX record. + * + * @return the exchange value. + */ + public String exchange() { + return this.exchange; + } + + /** + * Set the exchange property: The domain name of the mail host for this MX record. + * + * @param exchange the exchange value to set. + * @return the MxRecord object itself. + */ + public MxRecord withExchange(String exchange) { + this.exchange = exchange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZone.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZone.java new file mode 100644 index 0000000000000..59c40092f043c --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZone.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.privatedns.generated.fluent.models.PrivateZoneInner; +import java.util.Map; + +/** An immutable client-side representation of PrivateZone. */ +public interface PrivateZone { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: The ETag of the zone. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this Private + * DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfRecordSets value. + */ + Long maxNumberOfRecordSets(); + + /** + * Gets the numberOfRecordSets property: The current number of record sets in this Private DNS zone. This is a + * read-only property and any attempt to set this value will be ignored. + * + * @return the numberOfRecordSets value. + */ + Long numberOfRecordSets(); + + /** + * Gets the maxNumberOfVirtualNetworkLinks property: The maximum number of virtual networks that can be linked to + * this Private DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the maxNumberOfVirtualNetworkLinks value. + */ + Long maxNumberOfVirtualNetworkLinks(); + + /** + * Gets the numberOfVirtualNetworkLinks property: The current number of virtual networks that are linked to this + * Private DNS zone. This is a read-only property and any attempt to set this value will be ignored. + * + * @return the numberOfVirtualNetworkLinks value. + */ + Long numberOfVirtualNetworkLinks(); + + /** + * Gets the maxNumberOfVirtualNetworkLinksWithRegistration property: The maximum number of virtual networks that can + * be linked to this Private DNS zone with registration enabled. This is a read-only property and any attempt to set + * this value will be ignored. + * + * @return the maxNumberOfVirtualNetworkLinksWithRegistration value. + */ + Long maxNumberOfVirtualNetworkLinksWithRegistration(); + + /** + * Gets the numberOfVirtualNetworkLinksWithRegistration property: The current number of virtual networks that are + * linked to this Private DNS zone with registration enabled. This is a read-only property and any attempt to set + * this value will be ignored. + * + * @return the numberOfVirtualNetworkLinksWithRegistration value. + */ + Long numberOfVirtualNetworkLinksWithRegistration(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. This is a read-only property and any + * attempt to set this value will be ignored. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the internalId property: Private zone internal Id. + * + * @return the internalId value. + */ + String internalId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.privatedns.generated.fluent.models.PrivateZoneInner object. + * + * @return the inner object. + */ + PrivateZoneInner innerModel(); + + /** The entirety of the PrivateZone definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PrivateZone definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateZone definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PrivateZone definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PrivateZone definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PrivateZone definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithIfMatch, + DefinitionStages.WithIfNoneMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateZone create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateZone create(Context context); + } + /** The stage of the PrivateZone definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PrivateZone definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: The ETag of the zone.. + * + * @param etag The ETag of the zone. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the PrivateZone definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The ETag of the Private DNS zone. Omit this value to always overwrite the + * current zone. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + * changes.. + * + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. + * Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + /** The stage of the PrivateZone definition allowing to specify ifNoneMatch. */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: Set to '*' to allow a new Private DNS zone to be created, but to + * prevent updating an existing zone. Other values will be ignored.. + * + * @param ifNoneMatch Set to '*' to allow a new Private DNS zone to be created, but to prevent updating an + * existing zone. Other values will be ignored. + * @return the next definition stage. + */ + WithCreate withIfNoneMatch(String ifNoneMatch); + } + } + /** + * Begins update for the PrivateZone resource. + * + * @return the stage of resource update. + */ + PrivateZone.Update update(); + + /** The template for PrivateZone update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithEtag, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateZone apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateZone apply(Context context); + } + /** The PrivateZone update stages. */ + interface UpdateStages { + /** The stage of the PrivateZone update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PrivateZone update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: The ETag of the zone.. + * + * @param etag The ETag of the zone. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the PrivateZone update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The ETag of the Private DNS zone. Omit this value to always overwrite the + * current zone. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent + * changes.. + * + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. + * Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateZone refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateZone refresh(Context context); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZoneListResult.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZoneListResult.java new file mode 100644 index 0000000000000..7e6bb2bb9090f --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZoneListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.fluent.models.PrivateZoneInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a Private DNS zone list operation. */ +@Fluent +public final class PrivateZoneListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateZoneListResult.class); + + /* + * Information about the Private DNS zones. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The continuation token for the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Information about the Private DNS zones. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about the Private DNS zones. + * + * @param value the value value to set. + * @return the PrivateZoneListResult object itself. + */ + public PrivateZoneListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The continuation token for the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZones.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZones.java new file mode 100644 index 0000000000000..ad0d80d0e4e13 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PrivateZones.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateZones. */ +public interface PrivateZones { + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateZoneName, String ifMatch); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateZoneName); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateZoneName, String ifMatch, Context context); + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + PrivateZone getByResourceGroup(String resourceGroupName, String privateZoneName); + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateZoneName, Context context); + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + PagedIterable list(); + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param top The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + PagedIterable list(Integer top, Context context); + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a Private DNS zone list operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + PrivateZone getById(String id); + + /** + * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets + * within the zone. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Private DNS zone. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be + * undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed. + * + * @param id the resource ID. + * @param ifMatch The ETag of the Private DNS zone. Omit this value to always delete the current zone. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new PrivateZone resource. + * + * @param name resource name. + * @return the first stage of the new PrivateZone definition. + */ + PrivateZone.DefinitionStages.Blank define(String name); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/ProvisioningState.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..18373a91e936b --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/ProvisioningState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PtrRecord.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PtrRecord.java new file mode 100644 index 0000000000000..95107747e02c0 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/PtrRecord.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A PTR record. */ +@Fluent +public final class PtrRecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PtrRecord.class); + + /* + * The PTR target domain name for this PTR record. + */ + @JsonProperty(value = "ptrdname") + private String ptrdname; + + /** + * Get the ptrdname property: The PTR target domain name for this PTR record. + * + * @return the ptrdname value. + */ + public String ptrdname() { + return this.ptrdname; + } + + /** + * Set the ptrdname property: The PTR target domain name for this PTR record. + * + * @param ptrdname the ptrdname value to set. + * @return the PtrRecord object itself. + */ + public PtrRecord withPtrdname(String ptrdname) { + this.ptrdname = ptrdname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSet.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSet.java new file mode 100644 index 0000000000000..c4ac26286ca1f --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSet.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.resourcemanager.privatedns.generated.fluent.models.RecordSetInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RecordSet. */ +public interface RecordSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: The ETag of the record set. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the metadata property: The metadata attached to the record set. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the ttl property: The TTL (time-to-live) of the records in the record set. + * + * @return the ttl value. + */ + Long ttl(); + + /** + * Gets the fqdn property: Fully qualified domain name of the record set. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the isAutoRegistered property: Is the record set auto-registered in the Private DNS zone through a virtual + * network link?. + * + * @return the isAutoRegistered value. + */ + Boolean isAutoRegistered(); + + /** + * Gets the aRecords property: The list of A records in the record set. + * + * @return the aRecords value. + */ + List aRecords(); + + /** + * Gets the aaaaRecords property: The list of AAAA records in the record set. + * + * @return the aaaaRecords value. + */ + List aaaaRecords(); + + /** + * Gets the cnameRecord property: The CNAME record in the record set. + * + * @return the cnameRecord value. + */ + CnameRecord cnameRecord(); + + /** + * Gets the mxRecords property: The list of MX records in the record set. + * + * @return the mxRecords value. + */ + List mxRecords(); + + /** + * Gets the ptrRecords property: The list of PTR records in the record set. + * + * @return the ptrRecords value. + */ + List ptrRecords(); + + /** + * Gets the soaRecord property: The SOA record in the record set. + * + * @return the soaRecord value. + */ + SoaRecord soaRecord(); + + /** + * Gets the srvRecords property: The list of SRV records in the record set. + * + * @return the srvRecords value. + */ + List srvRecords(); + + /** + * Gets the txtRecords property: The list of TXT records in the record set. + * + * @return the txtRecords value. + */ + List txtRecords(); + + /** + * Gets the inner com.azure.resourcemanager.privatedns.generated.fluent.models.RecordSetInner object. + * + * @return the inner object. + */ + RecordSetInner innerModel(); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSetListResult.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSetListResult.java new file mode 100644 index 0000000000000..9d10bd22b56a9 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSetListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.fluent.models.RecordSetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a record set list operation. */ +@Fluent +public final class RecordSetListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecordSetListResult.class); + + /* + * Information about the record sets in the response. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The continuation token for the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Information about the record sets in the response. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about the record sets in the response. + * + * @param value the value value to set. + * @return the RecordSetListResult object itself. + */ + public RecordSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The continuation token for the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSets.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSets.java new file mode 100644 index 0000000000000..717c0f571999f --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordSets.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.privatedns.generated.fluent.models.RecordSetInner; + +/** Resource collection API of RecordSets. */ +public interface RecordSets { + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + RecordSet createOrUpdate( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters); + + /** + * Creates or updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated but not + * created (they are created when the Private DNS zone is created). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new record set to be created, but to prevent updating an existing record + * set. Other values will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + RecordSet update( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters); + + /** + * Updates a record set within a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @param ifMatch The ETag of the record set. Omit this value to always overwrite the current record set. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS + * zone. + */ + Response updateWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + RecordSetInner parameters, + String ifMatch, + Context context); + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName); + + /** + * Deletes a record set from a Private DNS zone. This operation cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are + * deleted when the Private DNS zone is deleted). + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param ifMatch The ETag of the record set. Omit this value to always delete the current record set. Specify the + * last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + String ifMatch, + Context context); + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + RecordSet get( + String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName); + + /** + * Gets a record set. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of DNS record in this record set. + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a record set. + */ + Response getWithResponse( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + String relativeRecordSetName, + Context context); + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + PagedIterable listByType(String resourceGroupName, String privateZoneName, RecordType recordType); + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param recordType The type of record sets to enumerate. + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + PagedIterable listByType( + String resourceGroupName, + String privateZoneName, + RecordType recordType, + Integer top, + String recordsetnamesuffix, + Context context); + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + PagedIterable list(String resourceGroupName, String privateZoneName); + + /** + * Lists all record sets in a Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + * @param recordsetnamesuffix The suffix label of the record set name to be used to filter the record set + * enumeration. If this parameter is specified, the returned enumeration will only contain records that end with + * ".<recordsetnamesuffix>". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a record set list operation. + */ + PagedIterable list( + String resourceGroupName, String privateZoneName, Integer top, String recordsetnamesuffix, Context context); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordType.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordType.java new file mode 100644 index 0000000000000..a7954065f7387 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/RecordType.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RecordType. */ +public enum RecordType { + /** Enum value A. */ + A("A"), + + /** Enum value AAAA. */ + AAAA("AAAA"), + + /** Enum value CNAME. */ + CNAME("CNAME"), + + /** Enum value MX. */ + MX("MX"), + + /** Enum value PTR. */ + PTR("PTR"), + + /** Enum value SOA. */ + SOA("SOA"), + + /** Enum value SRV. */ + SRV("SRV"), + + /** Enum value TXT. */ + TXT("TXT"); + + /** The actual serialized value for a RecordType instance. */ + private final String value; + + RecordType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecordType instance. + * + * @param value the serialized value to parse. + * @return the parsed RecordType object, or null if unable to parse. + */ + @JsonCreator + public static RecordType fromString(String value) { + RecordType[] items = RecordType.values(); + for (RecordType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/SoaRecord.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/SoaRecord.java new file mode 100644 index 0000000000000..98d1f5a284262 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/SoaRecord.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An SOA record. */ +@Fluent +public final class SoaRecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SoaRecord.class); + + /* + * The domain name of the authoritative name server for this SOA record. + */ + @JsonProperty(value = "host") + private String host; + + /* + * The email contact for this SOA record. + */ + @JsonProperty(value = "email") + private String email; + + /* + * The serial number for this SOA record. + */ + @JsonProperty(value = "serialNumber") + private Long serialNumber; + + /* + * The refresh value for this SOA record. + */ + @JsonProperty(value = "refreshTime") + private Long refreshTime; + + /* + * The retry time for this SOA record. + */ + @JsonProperty(value = "retryTime") + private Long retryTime; + + /* + * The expire time for this SOA record. + */ + @JsonProperty(value = "expireTime") + private Long expireTime; + + /* + * The minimum value for this SOA record. By convention this is used to + * determine the negative caching duration. + */ + @JsonProperty(value = "minimumTtl") + private Long minimumTtl; + + /** + * Get the host property: The domain name of the authoritative name server for this SOA record. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: The domain name of the authoritative name server for this SOA record. + * + * @param host the host value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the email property: The email contact for this SOA record. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The email contact for this SOA record. + * + * @param email the email value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the serialNumber property: The serial number for this SOA record. + * + * @return the serialNumber value. + */ + public Long serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number for this SOA record. + * + * @param serialNumber the serialNumber value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the refreshTime property: The refresh value for this SOA record. + * + * @return the refreshTime value. + */ + public Long refreshTime() { + return this.refreshTime; + } + + /** + * Set the refreshTime property: The refresh value for this SOA record. + * + * @param refreshTime the refreshTime value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withRefreshTime(Long refreshTime) { + this.refreshTime = refreshTime; + return this; + } + + /** + * Get the retryTime property: The retry time for this SOA record. + * + * @return the retryTime value. + */ + public Long retryTime() { + return this.retryTime; + } + + /** + * Set the retryTime property: The retry time for this SOA record. + * + * @param retryTime the retryTime value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withRetryTime(Long retryTime) { + this.retryTime = retryTime; + return this; + } + + /** + * Get the expireTime property: The expire time for this SOA record. + * + * @return the expireTime value. + */ + public Long expireTime() { + return this.expireTime; + } + + /** + * Set the expireTime property: The expire time for this SOA record. + * + * @param expireTime the expireTime value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withExpireTime(Long expireTime) { + this.expireTime = expireTime; + return this; + } + + /** + * Get the minimumTtl property: The minimum value for this SOA record. By convention this is used to determine the + * negative caching duration. + * + * @return the minimumTtl value. + */ + public Long minimumTtl() { + return this.minimumTtl; + } + + /** + * Set the minimumTtl property: The minimum value for this SOA record. By convention this is used to determine the + * negative caching duration. + * + * @param minimumTtl the minimumTtl value to set. + * @return the SoaRecord object itself. + */ + public SoaRecord withMinimumTtl(Long minimumTtl) { + this.minimumTtl = minimumTtl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/SrvRecord.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/SrvRecord.java new file mode 100644 index 0000000000000..371977fc0ae49 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/SrvRecord.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An SRV record. */ +@Fluent +public final class SrvRecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SrvRecord.class); + + /* + * The priority value for this SRV record. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The weight value for this SRV record. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * The port value for this SRV record. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The target domain name for this SRV record. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get the priority property: The priority value for this SRV record. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: The priority value for this SRV record. + * + * @param priority the priority value to set. + * @return the SrvRecord object itself. + */ + public SrvRecord withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: The weight value for this SRV record. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: The weight value for this SRV record. + * + * @param weight the weight value to set. + * @return the SrvRecord object itself. + */ + public SrvRecord withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the port property: The port value for this SRV record. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port value for this SRV record. + * + * @param port the port value to set. + * @return the SrvRecord object itself. + */ + public SrvRecord withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the target property: The target domain name for this SRV record. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target domain name for this SRV record. + * + * @param target the target value to set. + * @return the SrvRecord object itself. + */ + public SrvRecord withTarget(String target) { + this.target = target; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/TxtRecord.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/TxtRecord.java new file mode 100644 index 0000000000000..4852a945f89b2 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/TxtRecord.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A TXT record. */ +@Fluent +public final class TxtRecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TxtRecord.class); + + /* + * The text value of this TXT record. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The text value of this TXT record. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The text value of this TXT record. + * + * @param value the value value to set. + * @return the TxtRecord object itself. + */ + public TxtRecord withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLink.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLink.java new file mode 100644 index 0000000000000..5f91be062913c --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLink.java @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.privatedns.generated.fluent.models.VirtualNetworkLinkInner; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworkLink. */ +public interface VirtualNetworkLink { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: The ETag of the virtual network link. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the virtualNetwork property: The reference of the virtual network. + * + * @return the virtualNetwork value. + */ + SubResource virtualNetwork(); + + /** + * Gets the registrationEnabled property: Is auto-registration of virtual machine records in the virtual network in + * the Private DNS zone enabled?. + * + * @return the registrationEnabled value. + */ + Boolean registrationEnabled(); + + /** + * Gets the virtualNetworkLinkState property: The status of the virtual network link to the Private DNS zone. + * Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will + * be ignored. + * + * @return the virtualNetworkLinkState value. + */ + VirtualNetworkLinkState virtualNetworkLinkState(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. This is a read-only property and any + * attempt to set this value will be ignored. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.privatedns.generated.fluent.models.VirtualNetworkLinkInner object. + * + * @return the inner object. + */ + VirtualNetworkLinkInner innerModel(); + + /** The entirety of the VirtualNetworkLink definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The VirtualNetworkLink definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkLink definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetworkLink definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the VirtualNetworkLink definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateZoneName. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @return the next definition stage. + */ + WithCreate withExistingPrivateDnsZone(String resourceGroupName, String privateZoneName); + } + /** + * The stage of the VirtualNetworkLink definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithVirtualNetwork, + DefinitionStages.WithRegistrationEnabled, + DefinitionStages.WithIfMatch, + DefinitionStages.WithIfNoneMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkLink create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkLink create(Context context); + } + /** The stage of the VirtualNetworkLink definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VirtualNetworkLink definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: The ETag of the virtual network link.. + * + * @param etag The ETag of the virtual network link. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the VirtualNetworkLink definition allowing to specify virtualNetwork. */ + interface WithVirtualNetwork { + /** + * Specifies the virtualNetwork property: The reference of the virtual network.. + * + * @param virtualNetwork The reference of the virtual network. + * @return the next definition stage. + */ + WithCreate withVirtualNetwork(SubResource virtualNetwork); + } + /** The stage of the VirtualNetworkLink definition allowing to specify registrationEnabled. */ + interface WithRegistrationEnabled { + /** + * Specifies the registrationEnabled property: Is auto-registration of virtual machine records in the + * virtual network in the Private DNS zone enabled?. + * + * @param registrationEnabled Is auto-registration of virtual machine records in the virtual network in the + * Private DNS zone enabled?. + * @return the next definition stage. + */ + WithCreate withRegistrationEnabled(Boolean registrationEnabled); + } + /** The stage of the VirtualNetworkLink definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The ETag of the virtual network link to the Private DNS zone. Omit this + * value to always overwrite the current virtual network link. Specify the last-seen ETag value to prevent + * accidentally overwriting any concurrent changes.. + * + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always + * overwrite the current virtual network link. Specify the last-seen ETag value to prevent accidentally + * overwriting any concurrent changes. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + /** The stage of the VirtualNetworkLink definition allowing to specify ifNoneMatch. */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: Set to '*' to allow a new virtual network link to the Private DNS + * zone to be created, but to prevent updating an existing link. Other values will be ignored.. + * + * @param ifNoneMatch Set to '*' to allow a new virtual network link to the Private DNS zone to be created, + * but to prevent updating an existing link. Other values will be ignored. + * @return the next definition stage. + */ + WithCreate withIfNoneMatch(String ifNoneMatch); + } + } + /** + * Begins update for the VirtualNetworkLink resource. + * + * @return the stage of resource update. + */ + VirtualNetworkLink.Update update(); + + /** The template for VirtualNetworkLink update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithEtag, + UpdateStages.WithVirtualNetwork, + UpdateStages.WithRegistrationEnabled, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkLink apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkLink apply(Context context); + } + /** The VirtualNetworkLink update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkLink update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the VirtualNetworkLink update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: The ETag of the virtual network link.. + * + * @param etag The ETag of the virtual network link. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the VirtualNetworkLink update allowing to specify virtualNetwork. */ + interface WithVirtualNetwork { + /** + * Specifies the virtualNetwork property: The reference of the virtual network.. + * + * @param virtualNetwork The reference of the virtual network. + * @return the next definition stage. + */ + Update withVirtualNetwork(SubResource virtualNetwork); + } + /** The stage of the VirtualNetworkLink update allowing to specify registrationEnabled. */ + interface WithRegistrationEnabled { + /** + * Specifies the registrationEnabled property: Is auto-registration of virtual machine records in the + * virtual network in the Private DNS zone enabled?. + * + * @param registrationEnabled Is auto-registration of virtual machine records in the virtual network in the + * Private DNS zone enabled?. + * @return the next definition stage. + */ + Update withRegistrationEnabled(Boolean registrationEnabled); + } + /** The stage of the VirtualNetworkLink update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The ETag of the virtual network link to the Private DNS zone. Omit this + * value to always overwrite the current virtual network link. Specify the last-seen ETag value to prevent + * accidentally overwriting any concurrent changes.. + * + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always + * overwrite the current virtual network link. Specify the last-seen ETag value to prevent accidentally + * overwriting any concurrent changes. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkLink refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkLink refresh(Context context); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinkListResult.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinkListResult.java new file mode 100644 index 0000000000000..015c281c21474 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinkListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.privatedns.generated.fluent.models.VirtualNetworkLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a list virtual network link to Private DNS zone operation. */ +@Fluent +public final class VirtualNetworkLinkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkLinkListResult.class); + + /* + * Information about the virtual network links to the Private DNS zones. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The continuation token for the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Information about the virtual network links to the Private DNS zones. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about the virtual network links to the Private DNS zones. + * + * @param value the value value to set. + * @return the VirtualNetworkLinkListResult object itself. + */ + public VirtualNetworkLinkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The continuation token for the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinkState.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinkState.java new file mode 100644 index 0000000000000..6928ec6d8dd63 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinkState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkLinkState. */ +public final class VirtualNetworkLinkState extends ExpandableStringEnum { + /** Static value InProgress for VirtualNetworkLinkState. */ + public static final VirtualNetworkLinkState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for VirtualNetworkLinkState. */ + public static final VirtualNetworkLinkState COMPLETED = fromString("Completed"); + + /** + * Creates or finds a VirtualNetworkLinkState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkLinkState. + */ + @JsonCreator + public static VirtualNetworkLinkState fromString(String name) { + return fromString(name, VirtualNetworkLinkState.class); + } + + /** @return known VirtualNetworkLinkState values. */ + public static Collection values() { + return values(VirtualNetworkLinkState.class); + } +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinks.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinks.java new file mode 100644 index 0000000000000..efd701ac1f243 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/VirtualNetworkLinks.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.privatedns.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualNetworkLinks. */ +public interface VirtualNetworkLinks { + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String privateZoneName, + String virtualNetworkLinkName, + String ifMatch, + Context context); + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + VirtualNetworkLink get(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName); + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param virtualNetworkLinkName The name of the virtual network link. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + Response getWithResponse( + String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, Context context); + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + PagedIterable list(String resourceGroupName, String privateZoneName); + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + * @param top The maximum number of virtual network links to return. If not specified, returns up to 100 virtual + * network links. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list virtual network link to Private DNS zone operation. + */ + PagedIterable list( + String resourceGroupName, String privateZoneName, Integer top, Context context); + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + VirtualNetworkLink getById(String id); + + /** + * Gets a virtual network link to the specified Private DNS zone. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual network link to the specified Private DNS zone. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration virtual + * network, all auto-registered DNS records in the zone for the virtual network will also be deleted. This operation + * cannot be undone. + * + * @param id the resource ID. + * @param ifMatch The ETag of the virtual network link to the Private DNS zone. Omit this value to always delete the + * current zone. Specify the last-seen ETag value to prevent accidentally deleting any concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new VirtualNetworkLink resource. + * + * @param name resource name. + * @return the first stage of the new VirtualNetworkLink definition. + */ + VirtualNetworkLink.DefinitionStages.Blank define(String name); +} diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/package-info.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/package-info.java new file mode 100644 index 0000000000000..793d4bafeaccd --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for PrivateDnsManagementClient. The Private DNS Management Client. */ +package com.azure.resourcemanager.privatedns.generated.models; diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/package-info.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/package-info.java new file mode 100644 index 0000000000000..5acd1ced25f64 --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/com/azure/resourcemanager/privatedns/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for PrivateDnsManagementClient. The Private DNS Management Client. */ +package com.azure.resourcemanager.privatedns.generated; diff --git a/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/module-info.java b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..ee83478013d0a --- /dev/null +++ b/sdk/privatedns/azure-resourcemanager-privatedns-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.privatedns.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.privatedns.generated; + exports com.azure.resourcemanager.privatedns.generated.fluent; + exports com.azure.resourcemanager.privatedns.generated.fluent.models; + exports com.azure.resourcemanager.privatedns.generated.models; + + opens com.azure.resourcemanager.privatedns.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.privatedns.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/privatedns/ci.yml b/sdk/privatedns/ci.yml new file mode 100644 index 0000000000000..9c0e641861044 --- /dev/null +++ b/sdk/privatedns/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: privatedns + Artifacts: + - name: azure-resourcemanager-privatedns-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerprivatednsgenerated diff --git a/sdk/privatedns/pom.xml b/sdk/privatedns/pom.xml new file mode 100644 index 0000000000000..3522143391403 --- /dev/null +++ b/sdk/privatedns/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-privatedns-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-privatedns-generated + + + +