diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/CaaRecord.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/CaaRecord.java new file mode 100644 index 00000000000..b7046ac8979 --- /dev/null +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/CaaRecord.java @@ -0,0 +1,95 @@ +/** + * 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.dns; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A CAA record. + */ +public class CaaRecord { + /** + * The flags for this CAA record as an integer between 0 and 255. + */ + @JsonProperty(value = "flags") + private Integer flags; + + /** + * The tag for this CAA record. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * The value for this CAA record. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the flags value. + * + * @return the flags value + */ + public Integer flags() { + return this.flags; + } + + /** + * Set the flags value. + * + * @param flags the flags value to set + * @return the CaaRecord object itself. + */ + public CaaRecord withFlags(Integer flags) { + this.flags = flags; + return this; + } + + /** + * Get the tag value. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag value. + * + * @param tag the tag value to set + * @return the CaaRecord object itself. + */ + public CaaRecord withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the CaaRecord object itself. + */ + public CaaRecord withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/RecordType.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/RecordType.java index 808b8788dce..e58e20636df 100644 --- a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/RecordType.java +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/RecordType.java @@ -21,6 +21,9 @@ public enum RecordType { /** Enum value AAAA. */ AAAA("AAAA"), + /** Enum value CAA. */ + CAA("CAA"), + /** Enum value CNAME. */ CNAME("CNAME"), diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/SubResource.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/SubResource.java new file mode 100644 index 00000000000..22a22e18b9a --- /dev/null +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/SubResource.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.dns; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A reference to a another resource. + */ +public class SubResource { + /** + * Resource Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SubResource object itself. + */ + public SubResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/ZoneType.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/ZoneType.java new file mode 100644 index 00000000000..accad0e9800 --- /dev/null +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/ZoneType.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.dns; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ZoneType. + */ +public enum ZoneType { + /** Enum value Public. */ + PUBLIC("Public"), + + /** Enum value Private. */ + PRIVATE("Private"); + + /** The actual serialized value for a ZoneType instance. */ + private String value; + + ZoneType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ZoneType instance. + * + * @param value the serialized value to parse. + * @return the parsed ZoneType object, or null if unable to parse. + */ + @JsonCreator + public static ZoneType fromString(String value) { + ZoneType[] items = ZoneType.values(); + for (ZoneType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/ZoneUpdate.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/ZoneUpdate.java new file mode 100644 index 00000000000..316eec0e569 --- /dev/null +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/ZoneUpdate.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.dns; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a request to update a DNS zone. + */ +public class ZoneUpdate { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the ZoneUpdate object itself. + */ + public ZoneUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/DnsManagementClientImpl.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/DnsManagementClientImpl.java index 51faff77f8d..09f4b943f2a 100755 --- a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/DnsManagementClientImpl.java +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/DnsManagementClientImpl.java @@ -189,7 +189,7 @@ public DnsManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2016-04-01"; + this.apiVersion = "2018-03-01-preview"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -205,6 +205,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "DnsManagementClient", "2016-04-01"); + return String.format("%s (%s, %s)", super.userAgent(), "DnsManagementClient", "2018-03-01-preview"); } } diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/RecordSetInner.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/RecordSetInner.java index 24c39e85f1a..03cbfc5dee1 100644 --- a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/RecordSetInner.java +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/RecordSetInner.java @@ -19,6 +19,7 @@ import com.microsoft.azure.management.dns.TxtRecord; import com.microsoft.azure.management.dns.CnameRecord; import com.microsoft.azure.management.dns.SoaRecord; +import com.microsoft.azure.management.dns.CaaRecord; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -31,19 +32,19 @@ public class RecordSetInner { /** * The ID of the record set. */ - @JsonProperty(value = "id") + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /** * The name of the record set. */ - @JsonProperty(value = "name") + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /** * The type of the record set. */ - @JsonProperty(value = "type") + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /** @@ -64,6 +65,12 @@ public class RecordSetInner { @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; + /** * The list of A records in the record set. */ @@ -118,6 +125,12 @@ public class RecordSetInner { @JsonProperty(value = "properties.SOARecord") private SoaRecord soaRecord; + /** + * The list of CAA records in the record set. + */ + @JsonProperty(value = "properties.caaRecords") + private List caaRecords; + /** * Get the id value. * @@ -127,17 +140,6 @@ public String id() { return this.id; } - /** - * Set the id value. - * - * @param id the id value to set - * @return the RecordSetInner object itself. - */ - public RecordSetInner withId(String id) { - this.id = id; - return this; - } - /** * Get the name value. * @@ -147,17 +149,6 @@ public String name() { return this.name; } - /** - * Set the name value. - * - * @param name the name value to set - * @return the RecordSetInner object itself. - */ - public RecordSetInner withName(String name) { - this.name = name; - return this; - } - /** * Get the type value. * @@ -167,17 +158,6 @@ public String type() { return this.type; } - /** - * Set the type value. - * - * @param type the type value to set - * @return the RecordSetInner object itself. - */ - public RecordSetInner withType(String type) { - this.type = type; - return this; - } - /** * Get the etag value. * @@ -238,6 +218,15 @@ public RecordSetInner withTTL(Long tTL) { return this; } + /** + * Get the fqdn value. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + /** * Get the aRecords value. * @@ -418,4 +407,24 @@ public RecordSetInner withSoaRecord(SoaRecord soaRecord) { return this; } + /** + * Get the caaRecords value. + * + * @return the caaRecords value + */ + public List caaRecords() { + return this.caaRecords; + } + + /** + * Set the caaRecords value. + * + * @param caaRecords the caaRecords value to set + * @return the RecordSetInner object itself. + */ + public RecordSetInner withCaaRecords(List caaRecords) { + this.caaRecords = caaRecords; + return this; + } + } diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/RecordSetsInner.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/RecordSetsInner.java index 617c58504a4..98ad28dd923 100644 --- a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/RecordSetsInner.java +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/RecordSetsInner.java @@ -87,6 +87,10 @@ interface RecordSetsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets") Observable> listByDnsZone(@Path("resourceGroupName") String resourceGroupName, @Path("zoneName") String zoneName, @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.dns.RecordSets listAllByDnsZone" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all") + Observable> listAllByDnsZone(@Path("resourceGroupName") String resourceGroupName, @Path("zoneName") String zoneName, @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.dns.RecordSets listByTypeNext" }) @GET Observable> listByTypeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -95,6 +99,10 @@ interface RecordSetsService { @GET Observable> listByDnsZoneNext(@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.dns.RecordSets listAllByDnsZoneNext" }) + @GET + Observable> listAllByDnsZoneNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -103,7 +111,7 @@ interface RecordSetsService { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 @@ -120,7 +128,7 @@ public RecordSetInner update(String resourceGroupName, String zoneName, String r * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 @@ -136,7 +144,7 @@ public ServiceFuture updateAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @param parameters Parameters supplied to the Update operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RecordSetInner object @@ -156,7 +164,7 @@ public RecordSetInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @param parameters Parameters supplied to the Update operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RecordSetInner object @@ -205,7 +213,7 @@ public Observable> call(Response r * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 overwritting concurrent changes. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -223,7 +231,7 @@ public RecordSetInner update(String resourceGroupName, String zoneName, String r * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 overwritting concurrent changes. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -240,7 +248,7 @@ public ServiceFuture updateAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 overwritting concurrent changes. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -261,7 +269,7 @@ public RecordSetInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 overwritting concurrent changes. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -317,7 +325,7 @@ private ServiceResponse updateDelegate(Response re * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 @@ -334,7 +342,7 @@ public RecordSetInner createOrUpdate(String resourceGroupName, String zoneName, * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 @@ -350,7 +358,7 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupNam * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @param parameters Parameters supplied to the CreateOrUpdate operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RecordSetInner object @@ -370,7 +378,7 @@ public RecordSetInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @param parameters Parameters supplied to the CreateOrUpdate operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RecordSetInner object @@ -420,7 +428,7 @@ public Observable> call(Response r * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 overwritting 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. @@ -439,7 +447,7 @@ public RecordSetInner createOrUpdate(String resourceGroupName, String zoneName, * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 overwritting 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. @@ -457,7 +465,7 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupNam * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 overwritting 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. @@ -479,7 +487,7 @@ public RecordSetInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @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 DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 overwritting 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. @@ -525,8 +533,8 @@ public Observable> call(Response r private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -537,7 +545,7 @@ private ServiceResponse createOrUpdateDelegate(Response deleteAsync(String resourceGroupName, String zoneName * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ @@ -586,7 +594,7 @@ public Void call(ServiceResponse response) { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ @@ -630,7 +638,7 @@ public Observable> call(Response response) { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 @@ -646,7 +654,7 @@ public void delete(String resourceGroupName, String zoneName, String relativeRec * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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 @@ -662,7 +670,7 @@ public ServiceFuture deleteAsync(String resourceGroupName, String zoneName * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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. @@ -682,7 +690,7 @@ public Void call(ServiceResponse response) { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @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. @@ -722,8 +730,8 @@ public Observable> call(Response response) { private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, new TypeToken() { }.getType()) .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -734,7 +742,7 @@ private ServiceResponse deleteDelegate(Response response) th * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', '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 @@ -750,7 +758,7 @@ public RecordSetInner get(String resourceGroupName, String zoneName, String rela * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', '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 @@ -765,7 +773,7 @@ public ServiceFuture getAsync(String resourceGroupName, String z * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RecordSetInner object */ @@ -784,7 +792,7 @@ public RecordSetInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RecordSetInner object */ @@ -833,7 +841,7 @@ private ServiceResponse getDelegate(Response respo * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', '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 @@ -854,7 +862,7 @@ public Page nextPage(String nextPageLink) { * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', '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 @@ -876,7 +884,7 @@ public Observable>> call(String nextPageLin * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<RecordSetInner> object */ @@ -895,7 +903,7 @@ public Page call(ServiceResponse> response) * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<RecordSetInner> object */ @@ -918,7 +926,7 @@ public Observable>> call(ServiceResponse>> call(Response nextPage(String nextPageLink) { * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', '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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -1006,7 +1014,7 @@ public Observable>> call(String nextPageLin * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', '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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1027,7 +1035,7 @@ public Page call(ServiceResponse> response) * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', '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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1052,7 +1060,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param zoneName The name of the DNS zone (without a terminating dot). - ServiceResponse> * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' + ServiceResponse> * @param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', '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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1346,6 +1354,257 @@ private ServiceResponse> listByDnsZoneDelegate(Response .build(response); } + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the 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 listAllByDnsZone(final String resourceGroupName, final String zoneName) { + ServiceResponse> response = listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllByDnsZoneNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the 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> listAllByDnsZoneAsync(final String resourceGroupName, final String zoneName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllByDnsZoneNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable> listAllByDnsZoneAsync(final String resourceGroupName, final String zoneName) { + return listAllByDnsZoneWithServiceResponseAsync(resourceGroupName, zoneName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable>> listAllByDnsZoneWithServiceResponseAsync(final String resourceGroupName, final String zoneName) { + return listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName) + .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(listAllByDnsZoneNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the 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>> listAllByDnsZoneSinglePageAsync(final String resourceGroupName, final String zoneName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (zoneName == null) { + throw new IllegalArgumentException("Parameter zoneName 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.listAllByDnsZone(resourceGroupName, zoneName, 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 = listAllByDnsZoneDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the 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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only 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 listAllByDnsZone(final String resourceGroupName, final String zoneName, final Integer top, final String recordSetNameSuffix) { + ServiceResponse> response = listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordSetNameSuffix).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllByDnsZoneNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the 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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only 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> listAllByDnsZoneAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordSetNameSuffix, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordSetNameSuffix), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllByDnsZoneNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the 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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable> listAllByDnsZoneAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordSetNameSuffix) { + return listAllByDnsZoneWithServiceResponseAsync(resourceGroupName, zoneName, top, recordSetNameSuffix) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all record sets in a DNS zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the 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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecordSetInner> object + */ + public Observable>> listAllByDnsZoneWithServiceResponseAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordSetNameSuffix) { + return listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName, 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(listAllByDnsZoneNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all record sets in a DNS zone. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param zoneName The name of the 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 that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only 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>> listAllByDnsZoneSinglePageAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordSetNameSuffix) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (zoneName == null) { + throw new IllegalArgumentException("Parameter zoneName 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.listAllByDnsZone(resourceGroupName, zoneName, 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 = listAllByDnsZoneDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllByDnsZoneDelegate(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 DNS zone. * @@ -1568,4 +1827,115 @@ private ServiceResponse> listByDnsZoneNextDelegate(Resp .build(response); } + /** + * Lists all record sets in a 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 listAllByDnsZoneNext(final String nextPageLink) { + ServiceResponse> response = listAllByDnsZoneNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAllByDnsZoneNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all record sets in a 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> listAllByDnsZoneNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAllByDnsZoneNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAllByDnsZoneNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all record sets in a 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> listAllByDnsZoneNextAsync(final String nextPageLink) { + return listAllByDnsZoneNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all record sets in a 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>> listAllByDnsZoneNextWithServiceResponseAsync(final String nextPageLink) { + return listAllByDnsZoneNextSinglePageAsync(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(listAllByDnsZoneNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all record sets in a 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>> listAllByDnsZoneNextSinglePageAsync(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.listAllByDnsZoneNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAllByDnsZoneNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAllByDnsZoneNextDelegate(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/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZoneInner.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZoneInner.java index 0d9a4b90aad..06591549748 100644 --- a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZoneInner.java +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZoneInner.java @@ -9,6 +9,8 @@ package com.microsoft.azure.management.dns.implementation; import java.util.List; +import com.microsoft.azure.management.dns.ZoneType; +import com.microsoft.azure.management.dns.SubResource; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -29,14 +31,14 @@ public class ZoneInner extends Resource { * This is a read-only property and any attempt to set this value will be * ignored. */ - @JsonProperty(value = "properties.maxNumberOfRecordSets") + @JsonProperty(value = "properties.maxNumberOfRecordSets", access = JsonProperty.Access.WRITE_ONLY) private Long maxNumberOfRecordSets; /** * The current number of record sets in this DNS zone. This is a read-only * property and any attempt to set this value will be ignored. */ - @JsonProperty(value = "properties.numberOfRecordSets") + @JsonProperty(value = "properties.numberOfRecordSets", access = JsonProperty.Access.WRITE_ONLY) private Long numberOfRecordSets; /** @@ -46,6 +48,27 @@ public class ZoneInner extends Resource { @JsonProperty(value = "properties.nameServers", access = JsonProperty.Access.WRITE_ONLY) private List nameServers; + /** + * The type of this DNS zone (Public or Private). Possible values include: + * 'Public', 'Private'. + */ + @JsonProperty(value = "properties.zoneType") + private ZoneType zoneType; + + /** + * A list of references to virtual networks that register hostnames in this + * DNS zone. This is a only when ZoneType is Private. + */ + @JsonProperty(value = "properties.registrationVirtualNetworks") + private List registrationVirtualNetworks; + + /** + * A list of references to virtual networks that resolve records in this + * DNS zone. This is a only when ZoneType is Private. + */ + @JsonProperty(value = "properties.resolutionVirtualNetworks") + private List resolutionVirtualNetworks; + /** * Get the etag value. * @@ -76,43 +99,81 @@ public Long maxNumberOfRecordSets() { } /** - * Set the maxNumberOfRecordSets value. + * Get the numberOfRecordSets value. + * + * @return the numberOfRecordSets value + */ + public Long numberOfRecordSets() { + return this.numberOfRecordSets; + } + + /** + * Get the nameServers value. * - * @param maxNumberOfRecordSets the maxNumberOfRecordSets value to set + * @return the nameServers value + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Get the zoneType value. + * + * @return the zoneType value + */ + public ZoneType zoneType() { + return this.zoneType; + } + + /** + * Set the zoneType value. + * + * @param zoneType the zoneType value to set * @return the ZoneInner object itself. */ - public ZoneInner withMaxNumberOfRecordSets(Long maxNumberOfRecordSets) { - this.maxNumberOfRecordSets = maxNumberOfRecordSets; + public ZoneInner withZoneType(ZoneType zoneType) { + this.zoneType = zoneType; return this; } /** - * Get the numberOfRecordSets value. + * Get the registrationVirtualNetworks value. * - * @return the numberOfRecordSets value + * @return the registrationVirtualNetworks value */ - public Long numberOfRecordSets() { - return this.numberOfRecordSets; + public List registrationVirtualNetworks() { + return this.registrationVirtualNetworks; } /** - * Set the numberOfRecordSets value. + * Set the registrationVirtualNetworks value. * - * @param numberOfRecordSets the numberOfRecordSets value to set + * @param registrationVirtualNetworks the registrationVirtualNetworks value to set * @return the ZoneInner object itself. */ - public ZoneInner withNumberOfRecordSets(Long numberOfRecordSets) { - this.numberOfRecordSets = numberOfRecordSets; + public ZoneInner withRegistrationVirtualNetworks(List registrationVirtualNetworks) { + this.registrationVirtualNetworks = registrationVirtualNetworks; return this; } /** - * Get the nameServers value. + * Get the resolutionVirtualNetworks value. * - * @return the nameServers value + * @return the resolutionVirtualNetworks value */ - public List nameServers() { - return this.nameServers; + public List resolutionVirtualNetworks() { + return this.resolutionVirtualNetworks; + } + + /** + * Set the resolutionVirtualNetworks value. + * + * @param resolutionVirtualNetworks the resolutionVirtualNetworks value to set + * @return the ZoneInner object itself. + */ + public ZoneInner withResolutionVirtualNetworks(List resolutionVirtualNetworks) { + this.resolutionVirtualNetworks = resolutionVirtualNetworks; + return this; } } diff --git a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZonesInner.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZonesInner.java index 41a777a48fe..25c70e49a94 100644 --- a/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZonesInner.java +++ b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZonesInner.java @@ -16,6 +16,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.dns.ZoneUpdate; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -24,12 +25,14 @@ import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; +import java.util.Map; 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; @@ -42,7 +45,7 @@ * An instance of this class provides access to all the operations defined * in Zones. */ -public class ZonesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { +public class ZonesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private ZonesService service; /** The service client containing this operation class. */ @@ -80,6 +83,10 @@ interface ZonesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}") Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("zoneName") String zoneName, @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.dns.Zones update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("zoneName") String zoneName, @Path("subscriptionId") String subscriptionId, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ZoneUpdate parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.dns.Zones listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones") 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); @@ -298,10 +305,9 @@ private ServiceResponse createOrUpdateDelegate(Response * @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 ZoneDeleteResultInner object if successful. */ - public ZoneDeleteResultInner delete(String resourceGroupName, String zoneName) { - return deleteWithServiceResponseAsync(resourceGroupName, zoneName).toBlocking().last().body(); + public void delete(String resourceGroupName, String zoneName) { + deleteWithServiceResponseAsync(resourceGroupName, zoneName).toBlocking().last().body(); } /** @@ -313,7 +319,7 @@ public ZoneDeleteResultInner delete(String resourceGroupName, String zoneName) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String zoneName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String zoneName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, zoneName), serviceCallback); } @@ -325,10 +331,10 @@ public ServiceFuture deleteAsync(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String zoneName) { - return deleteWithServiceResponseAsync(resourceGroupName, zoneName).map(new Func1, ZoneDeleteResultInner>() { + public Observable deleteAsync(String resourceGroupName, String zoneName) { + return deleteWithServiceResponseAsync(resourceGroupName, zoneName).map(new Func1, Void>() { @Override - public ZoneDeleteResultInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -342,7 +348,7 @@ public ZoneDeleteResultInner call(ServiceResponse respons * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String zoneName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String zoneName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -357,7 +363,7 @@ public Observable> deleteWithServiceRespo } final String ifMatch = null; Observable> observable = service.delete(resourceGroupName, zoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. @@ -368,10 +374,9 @@ public Observable> deleteWithServiceRespo * @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 ZoneDeleteResultInner object if successful. */ - public ZoneDeleteResultInner delete(String resourceGroupName, String zoneName, String ifMatch) { - return deleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).toBlocking().last().body(); + public void delete(String resourceGroupName, String zoneName, String ifMatch) { + deleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).toBlocking().last().body(); } /** @@ -384,7 +389,7 @@ public ZoneDeleteResultInner delete(String resourceGroupName, String zoneName, S * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String zoneName, String ifMatch, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String zoneName, String ifMatch, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch), serviceCallback); } @@ -397,10 +402,10 @@ public ServiceFuture deleteAsync(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String zoneName, String ifMatch) { - return deleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).map(new Func1, ZoneDeleteResultInner>() { + public Observable deleteAsync(String resourceGroupName, String zoneName, String ifMatch) { + return deleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).map(new Func1, Void>() { @Override - public ZoneDeleteResultInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -415,7 +420,7 @@ public ZoneDeleteResultInner call(ServiceResponse respons * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String zoneName, String ifMatch) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String zoneName, String ifMatch) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -429,7 +434,7 @@ public Observable> deleteWithServiceRespo throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Observable> observable = service.delete(resourceGroupName, zoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -440,10 +445,9 @@ public Observable> deleteWithServiceRespo * @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 ZoneDeleteResultInner object if successful. */ - public ZoneDeleteResultInner beginDelete(String resourceGroupName, String zoneName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String zoneName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName).toBlocking().single().body(); } /** @@ -455,7 +459,7 @@ public ZoneDeleteResultInner beginDelete(String resourceGroupName, String zoneNa * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String zoneName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String zoneName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName), serviceCallback); } @@ -465,12 +469,12 @@ public ServiceFuture beginDeleteAsync(String resourceGrou * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ZoneDeleteResultInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String zoneName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName).map(new Func1, ZoneDeleteResultInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String zoneName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName).map(new Func1, Void>() { @Override - public ZoneDeleteResultInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -482,9 +486,9 @@ public ZoneDeleteResultInner call(ServiceResponse respons * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ZoneDeleteResultInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String zoneName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String zoneName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -499,11 +503,11 @@ public Observable> beginDeleteWithService } final String ifMatch = null; return service.beginDelete(resourceGroupName, zoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -521,10 +525,9 @@ public Observable> call(Response beginDeleteAsync(String resourceGroupName, String zoneName, String ifMatch, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String zoneName, String ifMatch, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch), serviceCallback); } @@ -548,12 +551,12 @@ public ServiceFuture beginDeleteAsync(String resourceGrou * @param zoneName The name of the DNS zone (without a terminating dot). * @param ifMatch The etag of the 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 to the ZoneDeleteResultInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String zoneName, String ifMatch) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).map(new Func1, ZoneDeleteResultInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String zoneName, String ifMatch) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).map(new Func1, Void>() { @Override - public ZoneDeleteResultInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -566,9 +569,9 @@ public ZoneDeleteResultInner call(ServiceResponse respons * @param zoneName The name of the DNS zone (without a terminating dot). * @param ifMatch The etag of the 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 to the ZoneDeleteResultInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String zoneName, String ifMatch) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String zoneName, String ifMatch) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -582,11 +585,11 @@ public Observable> beginDeleteWithService throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.beginDelete(resourceGroupName, zoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -595,11 +598,11 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(204, new TypeToken() { }.getType()) + 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(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -690,6 +693,186 @@ private ServiceResponse getByResourceGroupDelegate(Response updateAsync(String resourceGroupName, String zoneName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName), serviceCallback); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ZoneInner object + */ + public Observable updateAsync(String resourceGroupName, String zoneName) { + return updateWithServiceResponseAsync(resourceGroupName, zoneName).map(new Func1, ZoneInner>() { + @Override + public ZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ZoneInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String zoneName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (zoneName == null) { + throw new IllegalArgumentException("Parameter zoneName 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; + final Map tags = null; + ZoneUpdate parameters = new ZoneUpdate(); + parameters.withTags(null); + return service.update(resourceGroupName, zoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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 DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes. + * @param tags Resource tags. + * @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 ZoneInner object if successful. + */ + public ZoneInner update(String resourceGroupName, String zoneName, String ifMatch, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch, tags).toBlocking().single().body(); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes. + * @param tags Resource tags. + * @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 zoneName, String ifMatch, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch, tags), serviceCallback); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ZoneInner object + */ + public Observable updateAsync(String resourceGroupName, String zoneName, String ifMatch, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch, tags).map(new Func1, ZoneInner>() { + @Override + public ZoneInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a DNS zone. Does not modify DNS records within the zone. + * + * @param resourceGroupName The name of the resource group. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ZoneInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String zoneName, String ifMatch, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (zoneName == null) { + throw new IllegalArgumentException("Parameter zoneName 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."); + } + Validator.validate(tags); + ZoneUpdate parameters = new ZoneUpdate(); + parameters.withTags(tags); + return service.update(resourceGroupName, zoneName, this.client.subscriptionId(), ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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); + } + /** * Lists the DNS zones within a resource group. *