From d89570c854c3930db7efd2c98fe4e8e5d6ad456f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 4 Mar 2019 14:38:14 -0800 Subject: [PATCH] [AutoPR privatedns/resource-manager] Add private dns module name for java codegen (#3009) * Generated from e92e525831933bedf2242fe607984757387be1b2 Add private dns module name for java codegen * Update pom for private dns * change private dns version back to beta --- .../resource-manager/v2018_09_01/pom.xml | 133 ++ .../privatedns/v2018_09_01/ARecord.java | 43 + .../privatedns/v2018_09_01/AaaaRecord.java | 43 + .../privatedns/v2018_09_01/CnameRecord.java | 43 + .../privatedns/v2018_09_01/MxRecord.java | 69 + .../privatedns/v2018_09_01/PrivateZone.java | 168 ++ .../privatedns/v2018_09_01/PrivateZones.java | 25 + .../v2018_09_01/ProvisioningState.java | 53 + .../privatedns/v2018_09_01/PtrRecord.java | 43 + .../privatedns/v2018_09_01/RecordSet.java | 102 + .../privatedns/v2018_09_01/RecordSets.java | 92 + .../privatedns/v2018_09_01/RecordType.java | 71 + .../privatedns/v2018_09_01/SoaRecord.java | 200 ++ .../privatedns/v2018_09_01/SrvRecord.java | 121 ++ .../privatedns/v2018_09_01/TxtRecord.java | 44 + .../v2018_09_01/VirtualNetworkLink.java | 281 +++ .../v2018_09_01/VirtualNetworkLinkState.java | 41 + .../v2018_09_01/VirtualNetworkLinks.java | 53 + .../implementation/IdParsingUtils.java | 57 + .../v2018_09_01/implementation/PageImpl.java | 75 + .../PrivateDnsManagementClientImpl.java | 224 ++ .../implementation/PrivateZoneImpl.java | 112 + .../implementation/PrivateZoneInner.java | 167 ++ .../implementation/PrivateZonesImpl.java | 138 ++ .../implementation/PrivateZonesInner.java | 1875 +++++++++++++++++ .../implementation/RecordSetImpl.java | 116 + .../implementation/RecordSetInner.java | 348 +++ .../implementation/RecordSetsImpl.java | 111 + .../implementation/RecordSetsInner.java | 1571 ++++++++++++++ .../VirtualNetworkLinkImpl.java | 182 ++ .../VirtualNetworkLinkInner.java | 139 ++ .../VirtualNetworkLinksImpl.java | 81 + .../VirtualNetworkLinksInner.java | 1647 +++++++++++++++ .../implementation/package-info.java | 11 + .../implementation/privatednsManager.java | 123 ++ .../privatedns/v2018_09_01/package-info.java | 11 + 36 files changed, 8613 insertions(+) create mode 100644 privatedns/resource-manager/v2018_09_01/pom.xml create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/ARecord.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/AaaaRecord.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/CnameRecord.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/MxRecord.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PrivateZone.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PrivateZones.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/ProvisioningState.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PtrRecord.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordSet.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordSets.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordType.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/SoaRecord.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/SrvRecord.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/TxtRecord.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLink.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLinkState.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLinks.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/IdParsingUtils.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PageImpl.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateDnsManagementClientImpl.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZoneImpl.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZoneInner.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesImpl.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetImpl.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetInner.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsImpl.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsInner.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinkImpl.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinkInner.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksImpl.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/package-info.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/privatednsManager.java create mode 100644 privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/package-info.java diff --git a/privatedns/resource-manager/v2018_09_01/pom.xml b/privatedns/resource-manager/v2018_09_01/pom.xml new file mode 100644 index 0000000000000..04416606fe026 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.privatedns.v2018_09_01 + + com.microsoft.azure + azure-arm-parent + 1.0.0 + ../../../pom.xml + + azure-mgmt-privatedns + 1.0.0-beta + jar + Microsoft Azure SDK for Private DNS Management + This package contains Microsoft Private DNS Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/ARecord.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/ARecord.java new file mode 100644 index 0000000000000..6a120ff0d856f --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/ARecord.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An A record. + */ +public class ARecord { + /** + * The IPv4 address of this A record. + */ + @JsonProperty(value = "ipv4Address") + private String ipv4Address; + + /** + * Get the IPv4 address of this A record. + * + * @return the ipv4Address value + */ + public String ipv4Address() { + return this.ipv4Address; + } + + /** + * Set 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/AaaaRecord.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/AaaaRecord.java new file mode 100644 index 0000000000000..704f2d03b0444 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/AaaaRecord.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An AAAA record. + */ +public class AaaaRecord { + /** + * The IPv6 address of this AAAA record. + */ + @JsonProperty(value = "ipv6Address") + private String ipv6Address; + + /** + * Get the IPv6 address of this AAAA record. + * + * @return the ipv6Address value + */ + public String ipv6Address() { + return this.ipv6Address; + } + + /** + * Set 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/CnameRecord.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/CnameRecord.java new file mode 100644 index 0000000000000..4db6ec78b302e --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/CnameRecord.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A CNAME record. + */ +public class CnameRecord { + /** + * The canonical name for this CNAME record. + */ + @JsonProperty(value = "cname") + private String cname; + + /** + * Get the canonical name for this CNAME record. + * + * @return the cname value + */ + public String cname() { + return this.cname; + } + + /** + * Set 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/MxRecord.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/MxRecord.java new file mode 100644 index 0000000000000..989c34db3e63d --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/MxRecord.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An MX record. + */ +public class MxRecord { + /** + * 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 value for this MX record. + * + * @return the preference value + */ + public Integer preference() { + return this.preference; + } + + /** + * Set 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 domain name of the mail host for this MX record. + * + * @return the exchange value + */ + public String exchange() { + return this.exchange; + } + + /** + * Set 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PrivateZone.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PrivateZone.java new file mode 100644 index 0000000000000..263721205cb17 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PrivateZone.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.privatednsManager; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.PrivateZoneInner; + +/** + * Type representing PrivateZone. + */ +public interface PrivateZone extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the maxNumberOfRecordSets value. + */ + Long maxNumberOfRecordSets(); + + /** + * @return the maxNumberOfVirtualNetworkLinks value. + */ + Long maxNumberOfVirtualNetworkLinks(); + + /** + * @return the maxNumberOfVirtualNetworkLinksWithRegistration value. + */ + Long maxNumberOfVirtualNetworkLinksWithRegistration(); + + /** + * @return the numberOfRecordSets value. + */ + Long numberOfRecordSets(); + + /** + * @return the numberOfVirtualNetworkLinks value. + */ + Long numberOfVirtualNetworkLinks(); + + /** + * @return the numberOfVirtualNetworkLinksWithRegistration value. + */ + Long numberOfVirtualNetworkLinksWithRegistration(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the PrivateZone definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateZone definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateZone definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PrivateZone definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the privatezone definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @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 +*/ + WithIfNoneMatch withIfMatch(String ifMatch); + } + + /** + * The stage of the privatezone definition allowing to specify IfNoneMatch. + */ + interface WithIfNoneMatch { + /** + * Specifies ifNoneMatch. + * @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); + } + + /** + * The stage of the privatezone definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag of the zone + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEtag { + } + } + /** + * The template for a PrivateZone update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIfMatch, UpdateStages.WithEtag { + } + + /** + * Grouping of PrivateZone update stages. + */ + interface UpdateStages { + /** + * The stage of the privatezone update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @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 update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the privatezone update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag of the zone + * @return the next update stage + */ + Update withEtag(String etag); + } + + } +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PrivateZones.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PrivateZones.java new file mode 100644 index 0000000000000..a4e75f0b22168 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PrivateZones.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.PrivateZonesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateZones. + */ +public interface PrivateZones extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/ProvisioningState.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/ProvisioningState.java new file mode 100644 index 0000000000000..585f689da3043 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PtrRecord.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PtrRecord.java new file mode 100644 index 0000000000000..f2dcc9e6443b1 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/PtrRecord.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A PTR record. + */ +public class PtrRecord { + /** + * The PTR target domain name for this PTR record. + */ + @JsonProperty(value = "ptrdname") + private String ptrdname; + + /** + * Get the PTR target domain name for this PTR record. + * + * @return the ptrdname value + */ + public String ptrdname() { + return this.ptrdname; + } + + /** + * Set 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordSet.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordSet.java new file mode 100644 index 0000000000000..38b0f10a8c624 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordSet.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.privatednsManager; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.RecordSetInner; +import java.util.List; +import java.util.Map; + +/** + * Type representing RecordSet. + */ +public interface RecordSet extends HasInner, HasManager { + /** + * @return the aaaaRecords value. + */ + List aaaaRecords(); + + /** + * @return the aRecords value. + */ + List aRecords(); + + /** + * @return the cnameRecord value. + */ + CnameRecord cnameRecord(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the fqdn value. + */ + String fqdn(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isAutoRegistered value. + */ + Boolean isAutoRegistered(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the mxRecords value. + */ + List mxRecords(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the ptrRecords value. + */ + List ptrRecords(); + + /** + * @return the soaRecord value. + */ + SoaRecord soaRecord(); + + /** + * @return the srvRecords value. + */ + List srvRecords(); + + /** + * @return the ttl value. + */ + Long ttl(); + + /** + * @return the txtRecords value. + */ + List txtRecords(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordSets.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordSets.java new file mode 100644 index 0000000000000..f60d74b05c690 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordSets.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.RecordSetInner; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.RecordSetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RecordSets. + */ +public interface RecordSets extends HasInner { + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable for the request + */ + Observable createOrUpdateAsync(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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable for the request + */ + Observable updateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters); + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName); + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByTypeAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String privateZoneName); + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordType.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordType.java new file mode 100644 index 0000000000000..0e100446139d9 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/RecordType.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +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 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/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/SoaRecord.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/SoaRecord.java new file mode 100644 index 0000000000000..da79ee8d3dc1e --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/SoaRecord.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An SOA record. + */ +public class SoaRecord { + /** + * 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 domain name of the authoritative name server for this SOA record. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set 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 contact for this SOA record. + * + * @return the email value + */ + public String email() { + return this.email; + } + + /** + * Set 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 serial number for this SOA record. + * + * @return the serialNumber value + */ + public Long serialNumber() { + return this.serialNumber; + } + + /** + * Set 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 refresh value for this SOA record. + * + * @return the refreshTime value + */ + public Long refreshTime() { + return this.refreshTime; + } + + /** + * Set 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 retry time for this SOA record. + * + * @return the retryTime value + */ + public Long retryTime() { + return this.retryTime; + } + + /** + * Set 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 expire time for this SOA record. + * + * @return the expireTime value + */ + public Long expireTime() { + return this.expireTime; + } + + /** + * Set 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 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 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/SrvRecord.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/SrvRecord.java new file mode 100644 index 0000000000000..628b344bb22e5 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/SrvRecord.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An SRV record. + */ +public class SrvRecord { + /** + * 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 value for this SRV record. + * + * @return the priority value + */ + public Integer priority() { + return this.priority; + } + + /** + * Set 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 value for this SRV record. + * + * @return the weight value + */ + public Integer weight() { + return this.weight; + } + + /** + * Set 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 value for this SRV record. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set 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 domain name for this SRV record. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/TxtRecord.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/TxtRecord.java new file mode 100644 index 0000000000000..23e858e34eea9 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/TxtRecord.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A TXT record. + */ +public class TxtRecord { + /** + * The text value of this TXT record. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the text value of this TXT record. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLink.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLink.java new file mode 100644 index 0000000000000..0842383aacb01 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLink.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.VirtualNetworkLinkInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.privatednsManager; +import java.util.Map; +import com.microsoft.azure.SubResource; + +/** + * Type representing VirtualNetworkLink. + */ +public interface VirtualNetworkLink extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the registrationEnabled value. + */ + Boolean registrationEnabled(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetwork value. + */ + SubResource virtualNetwork(); + + /** + * @return the virtualNetworkLinkState value. + */ + VirtualNetworkLinkState virtualNetworkLinkState(); + + /** + * The entirety of the VirtualNetworkLink definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPrivateDnsZone, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkLink definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkLink definition. + */ + interface Blank extends WithPrivateDnsZone { + } + + /** + * The stage of the virtualnetworklink definition allowing to specify PrivateDnsZone. + */ + interface WithPrivateDnsZone { + /** + * 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 + */ + WithIfMatch withExistingPrivateDnsZone(String resourceGroupName, String privateZoneName); + } + + /** + * The stage of the virtualnetworklink definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @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 + */ + WithIfNoneMatch withIfMatch(String ifMatch); + } + + /** + * The stage of the virtualnetworklink definition allowing to specify IfNoneMatch. + */ + interface WithIfNoneMatch { + /** + * Specifies ifNoneMatch. + * @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); + } + + /** + * The stage of the virtualnetworklink definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @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 Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region where the resource lives + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the virtualnetworklink definition allowing to specify RegistrationEnabled. + */ + interface WithRegistrationEnabled { + /** + * Specifies registrationEnabled. + * @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 Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the virtualnetworklink definition allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies virtualNetwork. + * @param virtualNetwork The reference of the virtual network + * @return the next definition stage + */ + WithCreate withVirtualNetwork(SubResource virtualNetwork); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithLocation, DefinitionStages.WithRegistrationEnabled, DefinitionStages.WithTags, DefinitionStages.WithVirtualNetwork { + } + } + /** + * The template for a VirtualNetworkLink update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithEtag, UpdateStages.WithLocation, UpdateStages.WithRegistrationEnabled, UpdateStages.WithTags, UpdateStages.WithVirtualNetwork { + } + + /** + * Grouping of VirtualNetworkLink update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworklink update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @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 update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the virtualnetworklink update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag of the virtual network link + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the virtualnetworklink update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The Azure Region where the resource lives + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the virtualnetworklink update allowing to specify RegistrationEnabled. + */ + interface WithRegistrationEnabled { + /** + * Specifies registrationEnabled. + * @param registrationEnabled Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled? + * @return the next update stage + */ + Update withRegistrationEnabled(Boolean registrationEnabled); + } + + /** + * The stage of the virtualnetworklink update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the virtualnetworklink update allowing to specify VirtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies virtualNetwork. + * @param virtualNetwork The reference of the virtual network + * @return the next update stage + */ + Update withVirtualNetwork(SubResource virtualNetwork); + } + + } +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLinkState.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLinkState.java new file mode 100644 index 0000000000000..8d875b8898d1b --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLinkState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLinks.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLinks.java new file mode 100644 index 0000000000000..ee9465700fdd3 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/VirtualNetworkLinks.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.VirtualNetworkLinksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkLinks. + */ +public interface VirtualNetworkLinks extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String privateZoneName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName); + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/IdParsingUtils.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..75ffcc751d435 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PageImpl.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..00242acbf68ac --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateDnsManagementClientImpl.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateDnsManagementClientImpl.java new file mode 100644 index 0000000000000..736eae1b3b2a6 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateDnsManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the PrivateDnsManagementClientImpl class. + */ +public class PrivateDnsManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private 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 subscriptionId() { + return this.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 service client itself + */ + public PrivateDnsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public PrivateDnsManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public PrivateDnsManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public PrivateDnsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The PrivateZonesInner object to access its operations. + */ + private PrivateZonesInner privateZones; + + /** + * Gets the PrivateZonesInner object to access its operations. + * @return the PrivateZonesInner object. + */ + public PrivateZonesInner privateZones() { + return this.privateZones; + } + + /** + * The VirtualNetworkLinksInner object to access its operations. + */ + private VirtualNetworkLinksInner virtualNetworkLinks; + + /** + * Gets the VirtualNetworkLinksInner object to access its operations. + * @return the VirtualNetworkLinksInner object. + */ + public VirtualNetworkLinksInner virtualNetworkLinks() { + return this.virtualNetworkLinks; + } + + /** + * The RecordSetsInner object to access its operations. + */ + private RecordSetsInner recordSets; + + /** + * Gets the RecordSetsInner object to access its operations. + * @return the RecordSetsInner object. + */ + public RecordSetsInner recordSets() { + return this.recordSets; + } + + /** + * Initializes an instance of PrivateDnsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public PrivateDnsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of PrivateDnsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public PrivateDnsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of PrivateDnsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public PrivateDnsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-09-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.privateZones = new PrivateZonesInner(restClient().retrofit(), this); + this.virtualNetworkLinks = new VirtualNetworkLinksInner(restClient().retrofit(), this); + this.recordSets = new RecordSetsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "PrivateDnsManagementClient", "2018-09-01"); + } +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZoneImpl.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZoneImpl.java new file mode 100644 index 0000000000000..11927cee5a052 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZoneImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZone; +import rx.Observable; +import com.microsoft.azure.management.privatedns.v2018_09_01.ProvisioningState; + +class PrivateZoneImpl extends GroupableResourceCoreImpl implements PrivateZone, PrivateZone.Definition, PrivateZone.Update { + private String cifMatch; + private String cifNoneMatch; + private String uifMatch; + PrivateZoneImpl(String name, PrivateZoneInner inner, privatednsManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + PrivateZonesInner client = this.manager().inner().privateZones(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner(), this.cifMatch, this.cifNoneMatch) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateZonesInner client = this.manager().inner().privateZones(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner(), this.uifMatch) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateZonesInner client = this.manager().inner().privateZones(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Long maxNumberOfRecordSets() { + return this.inner().maxNumberOfRecordSets(); + } + + @Override + public Long maxNumberOfVirtualNetworkLinks() { + return this.inner().maxNumberOfVirtualNetworkLinks(); + } + + @Override + public Long maxNumberOfVirtualNetworkLinksWithRegistration() { + return this.inner().maxNumberOfVirtualNetworkLinksWithRegistration(); + } + + @Override + public Long numberOfRecordSets() { + return this.inner().numberOfRecordSets(); + } + + @Override + public Long numberOfVirtualNetworkLinks() { + return this.inner().numberOfVirtualNetworkLinks(); + } + + @Override + public Long numberOfVirtualNetworkLinksWithRegistration() { + return this.inner().numberOfVirtualNetworkLinksWithRegistration(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PrivateZoneImpl withIfNoneMatch(String ifNoneMatch) { + this.cifNoneMatch = ifNoneMatch; + return this; + } + + @Override + public PrivateZoneImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + + @Override + public PrivateZoneImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZoneInner.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZoneInner.java new file mode 100644 index 0000000000000..a0d96af9a7cc5 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZoneInner.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.management.privatedns.v2018_09_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Describes a Private DNS zone. + */ +@JsonFlatten +@SkipParentValidation +public class PrivateZoneInner extends Resource { + /** + * 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. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the ETag of the zone. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set 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 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 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 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 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 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 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 provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesImpl.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesImpl.java new file mode 100644 index 0000000000000..a8ea40a73de63 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones; +import com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZone; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class PrivateZonesImpl extends GroupableResourcesCoreImpl implements PrivateZones { + protected PrivateZonesImpl(privatednsManager manager) { + super(manager.inner().privateZones(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PrivateZonesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PrivateZonesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PrivateZonesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PrivateZonesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateZone call(PrivateZoneInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PrivateZonesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PrivateZonesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateZone call(PrivateZoneInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PrivateZoneImpl define(String name) { + return wrapModel(name); + } + + @Override + protected PrivateZoneImpl wrapModel(PrivateZoneInner inner) { + return new PrivateZoneImpl(inner.name(), inner, manager()); + } + + @Override + protected PrivateZoneImpl wrapModel(String name) { + return new PrivateZoneImpl(name, new PrivateZoneInner(), this.manager()); + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java new file mode 100644 index 0000000000000..303cc1195da81 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java @@ -0,0 +1,1875 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateZones. + */ +public class PrivateZonesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PrivateZonesService service; + /** The service client containing this operation class. */ + private PrivateDnsManagementClientImpl client; + + /** + * Initializes an instance of PrivateZonesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateZonesInner(Retrofit retrofit, PrivateDnsManagementClientImpl client) { + this.service = retrofit.create(PrivateZonesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateZones to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateZonesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Body PrivateZoneInner parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Body PrivateZoneInner parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Body PrivateZoneInner parameters, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Body PrivateZoneInner parameters, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/privateDnsZones") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner createOrUpdate(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + Observable> observable = service.createOrUpdate(resourceGroupName, privateZoneName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner createOrUpdate(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, privateZoneName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner beginCreateOrUpdate(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + return service.beginCreateOrUpdate(resourceGroupName, privateZoneName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner beginCreateOrUpdate(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, privateZoneName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner update(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + Observable> observable = service.update(resourceGroupName, privateZoneName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner update(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, privateZoneName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner beginUpdate(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + return service.beginUpdate(resourceGroupName, privateZoneName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner beginUpdate(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch), serviceCallback); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, privateZoneName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateZoneName) { + deleteWithServiceResponseAsync(resourceGroupName, privateZoneName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateZoneName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateZoneName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String privateZoneName) { + return deleteWithServiceResponseAsync(resourceGroupName, privateZoneName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String ifMatch = null; + Observable> observable = service.delete(resourceGroupName, privateZoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateZoneName, String ifMatch) { + deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, ifMatch).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateZoneName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, ifMatch), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String privateZoneName, String ifMatch) { + return deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, ifMatch).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, privateZoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateZoneName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateZoneName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateZoneName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String ifMatch = null; + return service.beginDelete(resourceGroupName, privateZoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateZoneName, String ifMatch) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, ifMatch).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateZoneName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, ifMatch), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateZoneName, String ifMatch) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, ifMatch).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, privateZoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateZoneInner object if successful. + */ + public PrivateZoneInner getByResourceGroup(String resourceGroupName, String privateZoneName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateZoneName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String privateZoneName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateZoneName), serviceCallback); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String privateZoneName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateZoneName).map(new Func1, PrivateZoneInner>() { + @Override + public PrivateZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PrivateZoneInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String privateZoneName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, privateZoneName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateZoneInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateZoneInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + return service.list(this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateZoneInner> object if successful. + */ + public PagedList list(final Integer top) { + ServiceResponse> response = listSinglePageAsync(top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable> listAsync(final Integer top) { + return listWithServiceResponseAsync(top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable>> listWithServiceResponseAsync(final Integer top) { + return listSinglePageAsync(top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + ServiceResponse> * @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 + * @return the PagedList<PrivateZoneInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateZoneInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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 + * @return the PagedList<PrivateZoneInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateZoneInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final Integer top) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final Integer top) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final Integer top) { + return listByResourceGroupSinglePageAsync(resourceGroupName, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Private DNS zones within a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @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 + * @return the PagedList<PrivateZoneInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateZoneInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Private DNS zones in all resource groups in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateZoneInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateZoneInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Private DNS zones within a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateZoneInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the Private DNS zones within a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateZoneInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetImpl.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetImpl.java new file mode 100644 index 0000000000000..120969ffbec87 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.management.privatedns.v2018_09_01.RecordSet; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.privatedns.v2018_09_01.AaaaRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.ARecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.CnameRecord; +import java.util.Map; +import com.microsoft.azure.management.privatedns.v2018_09_01.MxRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.PtrRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.SoaRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.SrvRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.TxtRecord; + +class RecordSetImpl extends WrapperImpl implements RecordSet { + private final privatednsManager manager; + RecordSetImpl(RecordSetInner inner, privatednsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public privatednsManager manager() { + return this.manager; + } + + @Override + public List aaaaRecords() { + return this.inner().aaaaRecords(); + } + + @Override + public List aRecords() { + return this.inner().aRecords(); + } + + @Override + public CnameRecord cnameRecord() { + return this.inner().cnameRecord(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String fqdn() { + return this.inner().fqdn(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isAutoRegistered() { + return this.inner().isAutoRegistered(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public List mxRecords() { + return this.inner().mxRecords(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List ptrRecords() { + return this.inner().ptrRecords(); + } + + @Override + public SoaRecord soaRecord() { + return this.inner().soaRecord(); + } + + @Override + public List srvRecords() { + return this.inner().srvRecords(); + } + + @Override + public Long ttl() { + return this.inner().ttl(); + } + + @Override + public List txtRecords() { + return this.inner().txtRecords(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetInner.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetInner.java new file mode 100644 index 0000000000000..a7427ef24a390 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetInner.java @@ -0,0 +1,348 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.privatedns.v2018_09_01.ARecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.AaaaRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.CnameRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.MxRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.PtrRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.SoaRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.SrvRecord; +import com.microsoft.azure.management.privatedns.v2018_09_01.TxtRecord; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Describes a DNS record set (a collection of DNS records with the same name + * and type) in a Private DNS zone. + */ +@JsonFlatten +public class RecordSetInner extends ProxyResource { + /** + * 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 of the record set. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set 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 attached to the record set. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set 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 (time-to-live) of the records in the record set. + * + * @return the ttl value + */ + public Long ttl() { + return this.ttl; + } + + /** + * Set 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 fully qualified domain name of the record set. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get 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 list of A records in the record set. + * + * @return the aRecords value + */ + public List aRecords() { + return this.aRecords; + } + + /** + * Set 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 list of AAAA records in the record set. + * + * @return the aaaaRecords value + */ + public List aaaaRecords() { + return this.aaaaRecords; + } + + /** + * Set 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 CNAME record in the record set. + * + * @return the cnameRecord value + */ + public CnameRecord cnameRecord() { + return this.cnameRecord; + } + + /** + * Set 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 list of MX records in the record set. + * + * @return the mxRecords value + */ + public List mxRecords() { + return this.mxRecords; + } + + /** + * Set 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 list of PTR records in the record set. + * + * @return the ptrRecords value + */ + public List ptrRecords() { + return this.ptrRecords; + } + + /** + * Set 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 SOA record in the record set. + * + * @return the soaRecord value + */ + public SoaRecord soaRecord() { + return this.soaRecord; + } + + /** + * Set 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 list of SRV records in the record set. + * + * @return the srvRecords value + */ + public List srvRecords() { + return this.srvRecords; + } + + /** + * Set 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 list of TXT records in the record set. + * + * @return the txtRecords value + */ + public List txtRecords() { + return this.txtRecords; + } + + /** + * Set 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; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsImpl.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsImpl.java new file mode 100644 index 0000000000000..a3cc6e54b1b8c --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.privatedns.v2018_09_01.RecordSet; +import com.microsoft.azure.management.privatedns.v2018_09_01.RecordType; + +class RecordSetsImpl extends WrapperImpl implements RecordSets { + private final privatednsManager manager; + + RecordSetsImpl(privatednsManager manager) { + super(manager.inner().recordSets()); + this.manager = manager; + } + + public privatednsManager manager() { + return this.manager; + } + + @Override + public Observable createOrUpdateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters) { + RecordSetsInner client = this.inner(); + return client.createOrUpdateAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters) + .map(new Func1() { + @Override + public RecordSet call(RecordSetInner inner) { + return new RecordSetImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters) { + RecordSetsInner client = this.inner(); + return client.updateAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters) + .map(new Func1() { + @Override + public RecordSet call(RecordSetInner inner) { + return new RecordSetImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + RecordSetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName).toCompletable(); + } + + @Override + public Observable getAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + RecordSetsInner client = this.inner(); + return client.getAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName) + .map(new Func1() { + @Override + public RecordSet call(RecordSetInner inner) { + return new RecordSetImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByTypeAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType) { + RecordSetsInner client = this.inner(); + return client.listByTypeAsync(resourceGroupName, privateZoneName, recordType) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RecordSet call(RecordSetInner inner) { + return new RecordSetImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String privateZoneName) { + RecordSetsInner client = this.inner(); + return client.listAsync(resourceGroupName, privateZoneName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RecordSet call(RecordSetInner inner) { + return new RecordSetImpl(inner, manager()); + } + }); + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsInner.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsInner.java new file mode 100644 index 0000000000000..04c715d64e22a --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsInner.java @@ -0,0 +1,1571 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.privatedns.v2018_09_01.RecordType; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RecordSets. + */ +public class RecordSetsInner { + /** The Retrofit service to perform REST calls. */ + private RecordSetsService service; + /** The service client containing this operation class. */ + private PrivateDnsManagementClientImpl client; + + /** + * Initializes an instance of RecordSetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RecordSetsInner(Retrofit retrofit, PrivateDnsManagementClientImpl client) { + this.service = retrofit.create(RecordSetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RecordSets to be + * used by Retrofit to perform actually REST calls. + */ + interface RecordSetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("recordType") RecordType recordType, @Path(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, @Path("subscriptionId") String subscriptionId, @Body RecordSetInner parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("recordType") RecordType recordType, @Path(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, @Path("subscriptionId") String subscriptionId, @Body RecordSetInner parameters, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("recordType") RecordType recordType, @Path(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, @Path("subscriptionId") String subscriptionId, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("recordType") RecordType recordType, @Path(value = "relativeRecordSetName", encoded = true) String relativeRecordSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets listByType" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/{recordType}") + Observable> listByType(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("recordType") RecordType recordType, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @Query("$recordsetnamesuffix") String recordsetnamesuffix, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/ALL") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @Query("$recordsetnamesuffix") String recordsetnamesuffix, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets listByTypeNext" }) + @GET + Observable> listByTypeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecordSetInner object if successful. + */ + public RecordSetInner createOrUpdate(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters).toBlocking().single().body(); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the CreateOrUpdate operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters), serviceCallback); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the RecordSetInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters).map(new Func1, RecordSetInner>() { + @Override + public RecordSetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the RecordSetInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (relativeRecordSetName == null) { + throw new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + return service.createOrUpdate(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecordSetInner object if successful. + */ + public RecordSetInner createOrUpdate(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, String ifMatch, String ifNoneMatch) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch).toBlocking().single().body(); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the RecordSetInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, String ifMatch, String ifNoneMatch) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch).map(new Func1, RecordSetInner>() { + @Override + public RecordSetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the RecordSetInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (relativeRecordSetName == null) { + throw new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecordSetInner object if successful. + */ + public RecordSetInner update(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters).toBlocking().single().body(); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param parameters Parameters supplied to the Update operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters), serviceCallback); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the RecordSetInner object + */ + public Observable updateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters).map(new Func1, RecordSetInner>() { + @Override + public RecordSetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the RecordSetInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (relativeRecordSetName == null) { + throw new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + return service.update(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecordSetInner object if successful. + */ + public RecordSetInner update(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch).toBlocking().single().body(); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch), serviceCallback); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the RecordSetInner object + */ + public Observable updateAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, parameters, ifMatch).map(new Func1, RecordSetInner>() { + @Override + public RecordSetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the RecordSetInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, RecordSetInner parameters, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (relativeRecordSetName == null) { + throw new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName).toBlocking().single().body(); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName), serviceCallback); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + return deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (relativeRecordSetName == null) { + throw new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String ifMatch = null; + return service.delete(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, String ifMatch) { + deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, ifMatch).toBlocking().single().body(); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, ifMatch), serviceCallback); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, String ifMatch) { + return deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, ifMatch).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (relativeRecordSetName == null) { + throw new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecordSetInner object if successful. + */ + public RecordSetInner get(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + return getWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName).toBlocking().single().body(); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName), serviceCallback); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecordSetInner object + */ + public Observable getAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + return getWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName).map(new Func1, RecordSetInner>() { + @Override + public RecordSetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param relativeRecordSetName The name of the record set, relative to the name of the zone. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecordSetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (relativeRecordSetName == null) { + throw new IllegalArgumentException("Parameter relativeRecordSetName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, privateZoneName, recordType, relativeRecordSetName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecordSetInner> object if successful. + */ + public PagedList listByType(final String resourceGroupName, final String privateZoneName, final RecordType recordType) { + ServiceResponse> response = listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByTypeAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable> listByTypeAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType) { + return listByTypeWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable>> listByTypeWithServiceResponseAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType) { + return listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecordSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByTypeSinglePageAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + final String recordsetnamesuffix = null; + return service.listByType(resourceGroupName, privateZoneName, recordType, this.client.subscriptionId(), top, recordsetnamesuffix, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecordSetInner> object if successful. + */ + public PagedList listByType(final String resourceGroupName, final String privateZoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix) { + ServiceResponse> response = listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByTypeAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable> listByTypeAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix) { + return listByTypeWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable>> listByTypeWithServiceResponseAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix) { + return listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType, top, recordsetnamesuffix) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + ServiceResponse> * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' + ServiceResponse> * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + ServiceResponse> * @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 + * @return the PagedList<RecordSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByTypeSinglePageAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (recordType == null) { + throw new IllegalArgumentException("Parameter recordType is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByType(resourceGroupName, privateZoneName, recordType, this.client.subscriptionId(), top, recordsetnamesuffix, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByTypeDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByTypeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecordSetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateZoneName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateZoneName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateZoneName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateZoneName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateZoneName) { + return listWithServiceResponseAsync(resourceGroupName, privateZoneName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateZoneName) { + return listSinglePageAsync(resourceGroupName, privateZoneName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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 + * @return the PagedList<RecordSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateZoneName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + final String recordsetnamesuffix = null; + return service.list(resourceGroupName, privateZoneName, this.client.subscriptionId(), top, recordsetnamesuffix, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecordSetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateZoneName, final Integer top, final String recordsetnamesuffix) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateZoneName, final Integer top, final String recordsetnamesuffix, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateZoneName, final Integer top, final String recordsetnamesuffix) { + return listWithServiceResponseAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateZoneName, final Integer top, final String recordsetnamesuffix) { + return listSinglePageAsync(resourceGroupName, privateZoneName, top, recordsetnamesuffix) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all record sets in a Private DNS zone. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + ServiceResponse> * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets. + ServiceResponse> * @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 + * @return the PagedList<RecordSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateZoneName, final Integer top, final String recordsetnamesuffix) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, privateZoneName, this.client.subscriptionId(), top, recordsetnamesuffix, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecordSetInner> object if successful. + */ + public PagedList listByTypeNext(final String nextPageLink) { + ServiceResponse> response = listByTypeNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByTypeNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByTypeNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByTypeNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable> listByTypeNextAsync(final String nextPageLink) { + return listByTypeNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable>> listByTypeNextWithServiceResponseAsync(final String nextPageLink) { + return listByTypeNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByTypeNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the record sets of a specified type in a Private DNS zone. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecordSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByTypeNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByTypeNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByTypeNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecordSetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all record sets in a Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all record sets in a Private DNS zone. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecordSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinkImpl.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinkImpl.java new file mode 100644 index 0000000000000..e7ecf460a36da --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinkImpl.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLink; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinkState; +import com.microsoft.azure.management.privatedns.v2018_09_01.ProvisioningState; + +class VirtualNetworkLinkImpl extends CreatableUpdatableImpl implements VirtualNetworkLink, VirtualNetworkLink.Definition, VirtualNetworkLink.Update { + private final privatednsManager manager; + private String resourceGroupName; + private String privateZoneName; + private String virtualNetworkLinkName; + private String cifMatch; + private String cifNoneMatch; + private String uifMatch; + + VirtualNetworkLinkImpl(String name, privatednsManager manager) { + super(name, new VirtualNetworkLinkInner()); + this.manager = manager; + // Set resource name + this.virtualNetworkLinkName = name; + // + } + + VirtualNetworkLinkImpl(VirtualNetworkLinkInner inner, privatednsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.virtualNetworkLinkName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateZoneName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateDnsZones"); + this.virtualNetworkLinkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworkLinks"); + // + } + + @Override + public privatednsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkLinksInner client = this.manager().inner().virtualNetworkLinks(); + return client.createOrUpdateAsync(this.resourceGroupName, this.privateZoneName, this.virtualNetworkLinkName, this.inner(), this.cifMatch, this.cifNoneMatch) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkLinksInner client = this.manager().inner().virtualNetworkLinks(); + return client.updateAsync(this.resourceGroupName, this.privateZoneName, this.virtualNetworkLinkName, this.inner(), this.uifMatch) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkLinksInner client = this.manager().inner().virtualNetworkLinks(); + return client.getAsync(this.resourceGroupName, this.privateZoneName, this.virtualNetworkLinkName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Boolean registrationEnabled() { + return this.inner().registrationEnabled(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SubResource virtualNetwork() { + return this.inner().virtualNetwork(); + } + + @Override + public VirtualNetworkLinkState virtualNetworkLinkState() { + return this.inner().virtualNetworkLinkState(); + } + + @Override + public VirtualNetworkLinkImpl withExistingPrivateDnsZone(String resourceGroupName, String privateZoneName) { + this.resourceGroupName = resourceGroupName; + this.privateZoneName = privateZoneName; + return this; + } + + @Override + public VirtualNetworkLinkImpl withIfNoneMatch(String ifNoneMatch) { + this.cifNoneMatch = ifNoneMatch; + return this; + } + + @Override + public VirtualNetworkLinkImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + + @Override + public VirtualNetworkLinkImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public VirtualNetworkLinkImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VirtualNetworkLinkImpl withRegistrationEnabled(Boolean registrationEnabled) { + this.inner().withRegistrationEnabled(registrationEnabled); + return this; + } + + @Override + public VirtualNetworkLinkImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public VirtualNetworkLinkImpl withVirtualNetwork(SubResource virtualNetwork) { + this.inner().withVirtualNetwork(virtualNetwork); + return this; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinkInner.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinkInner.java new file mode 100644 index 0000000000000..8532dbe6a35cb --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinkInner.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinkState; +import com.microsoft.azure.management.privatedns.v2018_09_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Describes a link to virtual network for a Private DNS zone. + */ +@JsonFlatten +@SkipParentValidation +public class VirtualNetworkLinkInner extends Resource { + /** + * 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. Possible values include: + * 'InProgress', 'Completed'. + */ + @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. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the ETag of the virtual network link. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set 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 reference of the virtual network. + * + * @return the virtualNetwork value + */ + public SubResource virtualNetwork() { + return this.virtualNetwork; + } + + /** + * Set 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 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 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 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. Possible values include: 'InProgress', 'Completed'. + * + * @return the virtualNetworkLinkState value + */ + public VirtualNetworkLinkState virtualNetworkLinkState() { + return this.virtualNetworkLinkState; + } + + /** + * Get the provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksImpl.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksImpl.java new file mode 100644 index 0000000000000..b80ba9dd52750 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLink; + +class VirtualNetworkLinksImpl extends WrapperImpl implements VirtualNetworkLinks { + private final privatednsManager manager; + + VirtualNetworkLinksImpl(privatednsManager manager) { + super(manager.inner().virtualNetworkLinks()); + this.manager = manager; + } + + public privatednsManager manager() { + return this.manager; + } + + @Override + public VirtualNetworkLinkImpl define(String name) { + return wrapModel(name); + } + + private VirtualNetworkLinkImpl wrapModel(VirtualNetworkLinkInner inner) { + return new VirtualNetworkLinkImpl(inner, manager()); + } + + private VirtualNetworkLinkImpl wrapModel(String name) { + return new VirtualNetworkLinkImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String privateZoneName) { + VirtualNetworkLinksInner client = this.inner(); + return client.listAsync(resourceGroupName, privateZoneName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualNetworkLink call(VirtualNetworkLinkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + VirtualNetworkLinksInner client = this.inner(); + return client.getAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName) + .map(new Func1() { + @Override + public VirtualNetworkLink call(VirtualNetworkLinkInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + VirtualNetworkLinksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName).toCompletable(); + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java new file mode 100644 index 0000000000000..bc4facc65e7b7 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java @@ -0,0 +1,1647 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualNetworkLinks. + */ +public class VirtualNetworkLinksInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkLinksService service; + /** The service client containing this operation class. */ + private PrivateDnsManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkLinksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkLinksInner(Retrofit retrofit, PrivateDnsManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkLinksService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkLinks to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkLinksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("virtualNetworkLinkName") String virtualNetworkLinkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkLinkInner parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("virtualNetworkLinkName") String virtualNetworkLinkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkLinkInner parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("virtualNetworkLinkName") String virtualNetworkLinkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkLinkInner parameters, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("virtualNetworkLinkName") String virtualNetworkLinkName, @Path("subscriptionId") String subscriptionId, @Body VirtualNetworkLinkInner parameters, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("virtualNetworkLinkName") String virtualNetworkLinkName, @Path("subscriptionId") String subscriptionId, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("virtualNetworkLinkName") String virtualNetworkLinkName, @Path("subscriptionId") String subscriptionId, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("virtualNetworkLinkName") String virtualNetworkLinkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("privateZoneName") String privateZoneName, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner createOrUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + Observable> observable = service.createOrUpdate(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner createOrUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner beginCreateOrUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + return service.beginCreateOrUpdate(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner beginCreateOrUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch, ifNoneMatch).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner update(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + Observable> observable = service.update(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner update(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner beginUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String ifMatch = null; + return service.beginUpdate(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner beginUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, ifMatch).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + return deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String ifMatch = null; + Observable> observable = service.delete(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + return deleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String ifMatch = null; + return service.beginDelete(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, ifMatch).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkLinkInner object if successful. + */ + public VirtualNetworkLinkInner get(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + return getWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName), serviceCallback); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable getAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + return getWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName).map(new Func1, VirtualNetworkLinkInner>() { + @Override + public VirtualNetworkLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the VirtualNetworkLinkInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (virtualNetworkLinkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkLinkName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, privateZoneName, virtualNetworkLinkName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkLinkInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateZoneName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateZoneName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateZoneName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateZoneName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkLinkInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateZoneName) { + return listWithServiceResponseAsync(resourceGroupName, privateZoneName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkLinkInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateZoneName) { + return listSinglePageAsync(resourceGroupName, privateZoneName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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 + * @return the PagedList<VirtualNetworkLinkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateZoneName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + return service.list(resourceGroupName, privateZoneName, this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkLinkInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateZoneName, final Integer top) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateZoneName, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateZoneName, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateZoneName, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkLinkInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateZoneName, final Integer top) { + return listWithServiceResponseAsync(resourceGroupName, privateZoneName, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<VirtualNetworkLinkInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateZoneName, final Integer top) { + return listSinglePageAsync(resourceGroupName, privateZoneName, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param privateZoneName The name of the Private DNS zone (without a terminating dot). + ServiceResponse> * @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 + * @return the PagedList<VirtualNetworkLinkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateZoneName, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateZoneName == null) { + throw new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, privateZoneName, this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualNetworkLinkInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkLinkInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkLinkInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the virtual network links to the specified Private DNS zone. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkLinkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/package-info.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/package-info.java new file mode 100644 index 0000000000000..7e61b31173b50 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for PrivateDnsManagementClient. + * The Private DNS Management Client. + */ +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/privatednsManager.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/privatednsManager.java new file mode 100644 index 0000000000000..757bcfb0134df --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/privatednsManager.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.privatedns.v2018_09_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.privatedns.v2018_09_01.PrivateZones; +import com.microsoft.azure.management.privatedns.v2018_09_01.VirtualNetworkLinks; +import com.microsoft.azure.management.privatedns.v2018_09_01.RecordSets; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Network resource management. + */ +public final class privatednsManager extends ManagerCore { + private PrivateZones privateZones; + private VirtualNetworkLinks virtualNetworkLinks; + private RecordSets recordSets; + /** + * Get a Configurable instance that can be used to create privatednsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new privatednsManager.ConfigurableImpl(); + } + /** + * Creates an instance of privatednsManager that exposes Network resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the privatednsManager + */ + public static privatednsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new privatednsManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of privatednsManager that exposes Network resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the privatednsManager + */ + public static privatednsManager authenticate(RestClient restClient, String subscriptionId) { + return new privatednsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of privatednsManager that exposes Network management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Network management API entry points that work across subscriptions + */ + privatednsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage PrivateZones. + */ + public PrivateZones privateZones() { + if (this.privateZones == null) { + this.privateZones = new PrivateZonesImpl(this); + } + return this.privateZones; + } + + /** + * @return Entry point to manage VirtualNetworkLinks. + */ + public VirtualNetworkLinks virtualNetworkLinks() { + if (this.virtualNetworkLinks == null) { + this.virtualNetworkLinks = new VirtualNetworkLinksImpl(this); + } + return this.virtualNetworkLinks; + } + + /** + * @return Entry point to manage RecordSets. + */ + public RecordSets recordSets() { + if (this.recordSets == null) { + this.recordSets = new RecordSetsImpl(this); + } + return this.recordSets; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public privatednsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return privatednsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private privatednsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new PrivateDnsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/package-info.java b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/package-info.java new file mode 100644 index 0000000000000..06320f5f75bd7 --- /dev/null +++ b/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for PrivateDnsManagementClient. + * The Private DNS Management Client. + */ +package com.microsoft.azure.management.privatedns.v2018_09_01;