Skip to content

Commit

Permalink
Generated from 89cf22d8de4f8659cbe1c7af1655f8f3b3d9621a
Browse files Browse the repository at this point in the history
Fix SDK breaking change in 2017-10-01 DNS Swagger ref Azure/azure-rest-api-specs#2612
  • Loading branch information
AutorestCI committed Mar 14, 2018
1 parent 2e717eb commit febe905
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -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<String, String> tags;

/**
* Get the tags value.
*
* @return the tags value
*/
public Map<String, String> tags() {
return this.tags;
}

/**
* Set the tags value.
*
* @param tags the tags value to set
* @return the ZoneUpdate object itself.
*/
public ZoneUpdate withTags(Map<String, String> tags) {
this.tags = tags;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<Response<ResponseBody>> 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<Response<ResponseBody>> 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")
Expand Down Expand Up @@ -696,41 +698,38 @@ private ServiceResponse<ZoneInner> getByResourceGroupDelegate(Response<ResponseB
*
* @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
* @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) {
return updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters).toBlocking().single().body();
public ZoneInner update(String resourceGroupName, String zoneName) {
return updateWithServiceResponseAsync(resourceGroupName, zoneName).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 parameters Parameters supplied to the Update operation.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<ZoneInner> updateAsync(String resourceGroupName, String zoneName, ZoneInner parameters, final ServiceCallback<ZoneInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters), serviceCallback);
public ServiceFuture<ZoneInner> updateAsync(String resourceGroupName, String zoneName, final ServiceCallback<ZoneInner> 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).
* @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<ZoneInner> updateAsync(String resourceGroupName, String zoneName, ZoneInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters).map(new Func1<ServiceResponse<ZoneInner>, ZoneInner>() {
public Observable<ZoneInner> updateAsync(String resourceGroupName, String zoneName) {
return updateWithServiceResponseAsync(resourceGroupName, zoneName).map(new Func1<ServiceResponse<ZoneInner>, ZoneInner>() {
@Override
public ZoneInner call(ServiceResponse<ZoneInner> response) {
return response.body();
Expand All @@ -743,11 +742,10 @@ public ZoneInner call(ServiceResponse<ZoneInner> 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<ServiceResponse<ZoneInner>> updateWithServiceResponseAsync(String resourceGroupName, String zoneName, ZoneInner parameters) {
public Observable<ServiceResponse<ZoneInner>> updateWithServiceResponseAsync(String resourceGroupName, String zoneName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
Expand All @@ -757,15 +755,14 @@ public Observable<ServiceResponse<ZoneInner>> 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<String, String> 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<Response<ResponseBody>, Observable<ServiceResponse<ZoneInner>>>() {
@Override
public Observable<ServiceResponse<ZoneInner>> call(Response<ResponseBody> response) {
Expand All @@ -784,44 +781,44 @@ public Observable<ServiceResponse<ZoneInner>> call(Response<ResponseBody> 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<String, String> 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 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<ZoneInner> updateAsync(String resourceGroupName, String zoneName, ZoneInner parameters, String ifMatch, final ServiceCallback<ZoneInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters, ifMatch), serviceCallback);
public ServiceFuture<ZoneInner> updateAsync(String resourceGroupName, String zoneName, String ifMatch, Map<String, String> tags, final ServiceCallback<ZoneInner> 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 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<ZoneInner> updateAsync(String resourceGroupName, String zoneName, ZoneInner parameters, String ifMatch) {
return updateWithServiceResponseAsync(resourceGroupName, zoneName, parameters, ifMatch).map(new Func1<ServiceResponse<ZoneInner>, ZoneInner>() {
public Observable<ZoneInner> updateAsync(String resourceGroupName, String zoneName, String ifMatch, Map<String, String> tags) {
return updateWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch, tags).map(new Func1<ServiceResponse<ZoneInner>, ZoneInner>() {
@Override
public ZoneInner call(ServiceResponse<ZoneInner> response) {
return response.body();
Expand All @@ -834,12 +831,12 @@ public ZoneInner call(ServiceResponse<ZoneInner> 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<ServiceResponse<ZoneInner>> updateWithServiceResponseAsync(String resourceGroupName, String zoneName, ZoneInner parameters, String ifMatch) {
public Observable<ServiceResponse<ZoneInner>> updateWithServiceResponseAsync(String resourceGroupName, String zoneName, String ifMatch, Map<String, String> tags) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
Expand All @@ -849,14 +846,13 @@ public Observable<ServiceResponse<ZoneInner>> 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<Response<ResponseBody>, Observable<ServiceResponse<ZoneInner>>>() {
@Override
public Observable<ServiceResponse<ZoneInner>> call(Response<ResponseBody> response) {
Expand Down

0 comments on commit febe905

Please sign in to comment.