From febe905746857e554a0a45d0e9da053ca5904d70 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 14 Mar 2018 20:04:03 +0000 Subject: [PATCH] Generated from 89cf22d8de4f8659cbe1c7af1655f8f3b3d9621a Fix SDK breaking change in 2017-10-01 DNS Swagger ref https://github.com/Azure/azure-rest-api-specs/pull/2612 --- .../azure/management/dns/ZoneUpdate.java | 44 +++++++++++++ .../dns/implementation/ZonesInner.java | 62 +++++++++---------- 2 files changed, 73 insertions(+), 33 deletions(-) create mode 100644 azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/ZoneUpdate.java 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/ZonesInner.java b/azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZonesInner.java index bc5c8ea09c5..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,6 +25,7 @@ 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; @@ -83,7 +85,7 @@ interface ZonesService { @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, @Body ZoneInner parameters, @Header("If-Match") String ifMatch, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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") @@ -696,14 +698,13 @@ private ServiceResponse getByResourceGroupDelegate(Response updateAsync(String resourceGroupName, String zoneName, ZoneInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String zoneName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName), serviceCallback); } /** @@ -725,12 +725,11 @@ public ServiceFuture updateAsync(String resourceGroupName, String zon * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the Update operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ZoneInner object */ - public Observable updateAsync(String resourceGroupName, String zoneName, ZoneInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters).map(new Func1, ZoneInner>() { + public Observable updateAsync(String resourceGroupName, String zoneName) { + return updateWithServiceResponseAsync(resourceGroupName, zoneName).map(new Func1, ZoneInner>() { @Override public ZoneInner call(ServiceResponse response) { return response.body(); @@ -743,11 +742,10 @@ public ZoneInner call(ServiceResponse response) { * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the Update operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ZoneInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String zoneName, ZoneInner parameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String zoneName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -757,15 +755,14 @@ public Observable> updateWithServiceResponseAsync(Str if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(parameters); final String ifMatch = null; - return service.update(resourceGroupName, zoneName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + 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) { @@ -784,15 +781,15 @@ public Observable> call(Response respon * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the Update operation. * @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, ZoneInner parameters, String ifMatch) { - return updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters, ifMatch).toBlocking().single().body(); + public ZoneInner update(String resourceGroupName, String zoneName, String ifMatch, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch, tags).toBlocking().single().body(); } /** @@ -800,14 +797,14 @@ public ZoneInner update(String resourceGroupName, String zoneName, ZoneInner par * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the Update operation. * @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, ZoneInner parameters, String ifMatch, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters, ifMatch), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String zoneName, String ifMatch, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch, tags), serviceCallback); } /** @@ -815,13 +812,13 @@ public ServiceFuture updateAsync(String resourceGroupName, String zon * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the Update operation. * @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, ZoneInner parameters, String ifMatch) { - return updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters, ifMatch).map(new Func1, ZoneInner>() { + 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(); @@ -834,12 +831,12 @@ public ZoneInner call(ServiceResponse response) { * * @param resourceGroupName The name of the resource group. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param parameters Parameters supplied to the Update operation. * @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, ZoneInner parameters, String ifMatch) { + 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."); } @@ -849,14 +846,13 @@ public Observable> updateWithServiceResponseAsync(Str if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(parameters); - return service.update(resourceGroupName, zoneName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + 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) {