diff --git a/resources/resource-manager/v2018_02_01/pom.xml b/resources/resource-manager/v2018_02_01/pom.xml index e818f341267c3..422e8edf74c65 100644 --- a/resources/resource-manager/v2018_02_01/pom.xml +++ b/resources/resource-manager/v2018_02_01/pom.xml @@ -15,11 +15,11 @@ ../../../pom.management.xml azure-mgmt-resources - 1.0.0-beta-1 + 1.0.0-beta jar Microsoft Azure SDK for Resources Management This package contains Microsoft Resources Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/DeploymentExtended.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/DeploymentExtended.java index e1dec4004aec6..b15b190ad025c 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/DeploymentExtended.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/DeploymentExtended.java @@ -59,6 +59,8 @@ interface Blank extends WithResourceGroupName { interface WithResourceGroupName { /** * Specifies resourceGroupName. + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist + * @return the next definition stage */ WithProperties withResourceGroupName(String resourceGroupName); } @@ -69,6 +71,8 @@ interface WithResourceGroupName { interface WithProperties { /** * Specifies properties. + * @param properties The deployment properties + * @return the next definition stage */ WithCreate withProperties(DeploymentProperties properties); } @@ -97,6 +101,8 @@ interface UpdateStages { interface WithProperties { /** * Specifies properties. + * @param properties The deployment properties + * @return the next update stage */ Update withProperties(DeploymentProperties properties); } diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/DeploymentPropertiesExtended.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/DeploymentPropertiesExtended.java index 2a3eb61e53fc9..61027f45b92a1 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/DeploymentPropertiesExtended.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/DeploymentPropertiesExtended.java @@ -36,7 +36,7 @@ public class DeploymentPropertiesExtended { private DateTime timestamp; /** - * Key/value pairs that represent deploymentoutput. + * Key/value pairs that represent deployment output. */ @JsonProperty(value = "outputs") private Object outputs; @@ -126,7 +126,7 @@ public DateTime timestamp() { } /** - * Get key/value pairs that represent deploymentoutput. + * Get key/value pairs that represent deployment output. * * @return the outputs value */ @@ -135,7 +135,7 @@ public Object outputs() { } /** - * Set key/value pairs that represent deploymentoutput. + * Set key/value pairs that represent deployment output. * * @param outputs the outputs value to set * @return the DeploymentPropertiesExtended object itself. diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/Deployments.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/Deployments.java index ab1b9412c9c4e..000dddfa36c1e 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/Deployments.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/Deployments.java @@ -30,7 +30,7 @@ public interface Deployments extends SupportsCreating checkExistenceAsync(String resourceGroupName, String deploymentName); /** * Cancels a currently running template deployment. @@ -64,4 +64,13 @@ public interface Deployments extends SupportsCreating exportTemplateAsync(String resourceGroupName, String deploymentName); + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable calculateTemplateHashAsync(Object template); + } diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ErrorAdditionalInfo.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..3d370cd021288 --- /dev/null +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ErrorAdditionalInfo.java @@ -0,0 +1,47 @@ +/** + * 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.resources.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ErrorResponse.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ErrorResponse.java new file mode 100644 index 0000000000000..0d2b36a829aae --- /dev/null +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ErrorResponse.java @@ -0,0 +1,93 @@ +/** + * 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.resources.v2018_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error response. + */ +public class ErrorResponse { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ExportTemplateRequest.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ExportTemplateRequest.java index 3c7c218923a08..eda948928615a 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ExportTemplateRequest.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ExportTemplateRequest.java @@ -16,23 +16,23 @@ */ public class ExportTemplateRequest { /** - * The IDs of the resources. The only supported string currently is '*' - * (all resources). Future updates will support exporting specific - * resources. + * The IDs of the resources to filter the export by. To export all + * resources, supply an array with single entry '*'. */ @JsonProperty(value = "resources") private List resources; /** - * The export template options. Supported values include - * 'IncludeParameterDefaultValue', 'IncludeComments' or - * 'IncludeParameterDefaultValue, IncludeComments. + * The export template options. A CSV-formatted list containing zero or + * more of the following: 'IncludeParameterDefaultValue', + * 'IncludeComments', 'SkipResourceNameParameterization', + * 'SkipAllParameterization'. */ @JsonProperty(value = "options") private String options; /** - * Get the IDs of the resources. The only supported string currently is '*' (all resources). Future updates will support exporting specific resources. + * Get the IDs of the resources to filter the export by. To export all resources, supply an array with single entry '*'. * * @return the resources value */ @@ -41,7 +41,7 @@ public List resources() { } /** - * Set the IDs of the resources. The only supported string currently is '*' (all resources). Future updates will support exporting specific resources. + * Set the IDs of the resources to filter the export by. To export all resources, supply an array with single entry '*'. * * @param resources the resources value to set * @return the ExportTemplateRequest object itself. @@ -52,7 +52,7 @@ public ExportTemplateRequest withResources(List resources) { } /** - * Get the export template options. Supported values include 'IncludeParameterDefaultValue', 'IncludeComments' or 'IncludeParameterDefaultValue, IncludeComments. + * Get the export template options. A CSV-formatted list containing zero or more of the following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', 'SkipAllParameterization'. * * @return the options value */ @@ -61,7 +61,7 @@ public String options() { } /** - * Set the export template options. Supported values include 'IncludeParameterDefaultValue', 'IncludeComments' or 'IncludeParameterDefaultValue, IncludeComments. + * Set the export template options. A CSV-formatted list containing zero or more of the following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', 'SkipAllParameterization'. * * @param options the options value to set * @return the ExportTemplateRequest object itself. diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ParametersLink.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ParametersLink.java index 6e7632d8f5551..ba8711528d532 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ParametersLink.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ParametersLink.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Entity representing the reference to the deployment paramaters. + * Entity representing the reference to the deployment parameters. */ public class ParametersLink { /** diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ResourceGroup.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ResourceGroup.java index 3652cf418a5b5..5b57231a7e3c1 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ResourceGroup.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ResourceGroup.java @@ -75,6 +75,7 @@ interface Blank extends WithSubscription { interface WithSubscription { /** * Specifies . + * @return the next definition stage */ WithLocation withExistingSubscription(); } @@ -85,6 +86,8 @@ interface WithSubscription { interface WithLocation { /** * Specifies location. + * @param location The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations + * @return the next definition stage */ WithCreate withLocation(String location); } @@ -95,6 +98,8 @@ interface WithLocation { interface WithManagedBy { /** * Specifies managedBy. + * @param managedBy The ID of the resource that manages this resource group + * @return the next definition stage */ WithCreate withManagedBy(String managedBy); } @@ -105,6 +110,8 @@ interface WithManagedBy { interface WithName { /** * Specifies name. + * @param name The name of the resource group + * @return the next definition stage */ WithCreate withName(String name); } @@ -115,6 +122,8 @@ interface WithName { interface WithProperties { /** * Specifies properties. + * @param properties the properties parameter value + * @return the next definition stage */ WithCreate withProperties(ResourceGroupProperties properties); } @@ -125,6 +134,8 @@ interface WithProperties { interface WithTags { /** * Specifies tags. + * @param tags The tags attached to the resource group + * @return the next definition stage */ WithCreate withTags(Map tags); } @@ -153,6 +164,8 @@ interface UpdateStages { interface WithManagedBy { /** * Specifies managedBy. + * @param managedBy The ID of the resource that manages this resource group + * @return the next update stage */ Update withManagedBy(String managedBy); } @@ -163,6 +176,8 @@ interface WithManagedBy { interface WithName { /** * Specifies name. + * @param name The name of the resource group + * @return the next update stage */ Update withName(String name); } @@ -173,6 +188,8 @@ interface WithName { interface WithProperties { /** * Specifies properties. + * @param properties the properties parameter value + * @return the next update stage */ Update withProperties(ResourceGroupProperties properties); } @@ -183,6 +200,8 @@ interface WithProperties { interface WithTags { /** * Specifies tags. + * @param tags The tags attached to the resource group + * @return the next update stage */ Update withTags(Map tags); } diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ResourceGroups.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ResourceGroups.java index aa21480a91cae..9393810d6c628 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ResourceGroups.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/ResourceGroups.java @@ -25,7 +25,7 @@ public interface ResourceGroups extends SupportsCreating checkExistenceAsync(String resourceGroupName); /** * Captures the specified resource group as a template. diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/Resources.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/Resources.java index ea0f13adfa3de..31815daed7108 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/Resources.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/Resources.java @@ -34,7 +34,7 @@ public interface Resources extends HasInner { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Completable checkExistenceByIdAsync(String resourceId, String apiVersion); + Observable checkExistenceByIdAsync(String resourceId, String apiVersion); /** * Deletes a resource by ID. @@ -121,7 +121,7 @@ public interface Resources extends HasInner { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Completable checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion); + Observable checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion); /** * Deletes a resource. diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/TemplateHashResult.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/TemplateHashResult.java new file mode 100644 index 0000000000000..35c7894b0a0e2 --- /dev/null +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/TemplateHashResult.java @@ -0,0 +1,30 @@ +/** + * 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.resources.v2018_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.resources.v2018_02_01.implementation.ResourcesManager; +import com.microsoft.azure.management.resources.v2018_02_01.implementation.TemplateHashResultInner; + +/** + * Type representing TemplateHashResult. + */ +public interface TemplateHashResult extends HasInner, HasManager { + /** + * @return the minifiedTemplate value. + */ + String minifiedTemplate(); + + /** + * @return the templateHash value. + */ + String templateHash(); + +} diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentExtendedImpl.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentExtendedImpl.java index 62c9568f500bd..5a1230b0f757b 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentExtendedImpl.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentExtendedImpl.java @@ -38,10 +38,10 @@ class DeploymentExtendedImpl extends CreatableUpdatableImpl getDeploymentOperationInnerUsingDep public Observable getAsync(String resourceGroupName, String deploymentName, String operationId) { DeploymentOperationsInner client = this.inner(); return client.getAsync(resourceGroupName, deploymentName, operationId) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public DeploymentOperation call(DeploymentOperationInner inner) { - return wrapDeploymentOperationModel(inner); + public Observable call(DeploymentOperationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DeploymentOperation)wrapDeploymentOperationModel(inner)); + } } }); } diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsImpl.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsImpl.java index 836d208a17578..c08d8e325cec5 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsImpl.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsImpl.java @@ -25,6 +25,7 @@ import com.microsoft.rest.ServiceCallback; import com.microsoft.azure.management.resources.v2018_02_01.DeploymentValidateResult; import com.microsoft.azure.management.resources.v2018_02_01.DeploymentExportResult; +import com.microsoft.azure.management.resources.v2018_02_01.TemplateHashResult; import com.microsoft.azure.management.resources.v2018_02_01.DeploymentProperties; import com.microsoft.azure.arm.utils.PagedListConverter; import com.microsoft.azure.management.resources.v2018_02_01.DeploymentExtended; @@ -62,10 +63,10 @@ private DeploymentExtendedImpl wrapModel(String name) { } @Override - public Completable checkExistenceAsync(String resourceGroupName, String deploymentName) { + public Observable checkExistenceAsync(String resourceGroupName, String deploymentName) { DeploymentsInner client = this.inner(); - return client.checkExistenceAsync(resourceGroupName, deploymentName).toCompletable(); - } + return client.checkExistenceAsync(resourceGroupName, deploymentName) + ;} @Override public Completable cancelAsync(String resourceGroupName, String deploymentName) { @@ -97,6 +98,18 @@ public DeploymentExportResult call(DeploymentExportResultInner inner) { }); } + @Override + public Observable calculateTemplateHashAsync(Object template) { + DeploymentsInner client = this.inner(); + return client.calculateTemplateHashAsync(template) + .map(new Func1() { + @Override + public TemplateHashResult call(TemplateHashResultInner inner) { + return new TemplateHashResultImpl(inner, manager()); + } + }); + } + @Override public PagedList listByResourceGroup(String resourceGroupName) { DeploymentsInner client = this.inner(); @@ -133,10 +146,14 @@ public DeploymentExtended getByResourceGroup(String resourceGroupName, String na @Override public Observable getByResourceGroupAsync(String resourceGroupName, String name) { - return this.getInnerAsync(resourceGroupName, name).map(new Func1 () { + return this.getInnerAsync(resourceGroupName, name).flatMap(new Func1> () { @Override - public DeploymentExtended call(DeploymentExtendedInner innerT) { - return wrapModel(innerT); + public Observable call(DeploymentExtendedInner innerT) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DeploymentExtended)wrapModel(innerT)); + } } }); } diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java index d27b9c280b97d..4aeeaf57d736d 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java @@ -106,6 +106,10 @@ interface DeploymentsService { @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/") Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2018_02_01.Deployments calculateTemplateHash" }) + @POST("providers/Microsoft.Resources/calculateTemplateHash") + Observable> calculateTemplateHash(@Query("api-version") String apiVersion, @Body Object template, @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.resources.v2018_02_01.Deployments listByResourceGroupNext" }) @GET Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1138,6 +1142,82 @@ private ServiceResponse> listByResourceGroupDe .build(response); } + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @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 TemplateHashResultInner object if successful. + */ + public TemplateHashResultInner calculateTemplateHash(Object template) { + return calculateTemplateHashWithServiceResponseAsync(template).toBlocking().single().body(); + } + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @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 calculateTemplateHashAsync(Object template, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(calculateTemplateHashWithServiceResponseAsync(template), serviceCallback); + } + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TemplateHashResultInner object + */ + public Observable calculateTemplateHashAsync(Object template) { + return calculateTemplateHashWithServiceResponseAsync(template).map(new Func1, TemplateHashResultInner>() { + @Override + public TemplateHashResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TemplateHashResultInner object + */ + public Observable> calculateTemplateHashWithServiceResponseAsync(Object template) { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (template == null) { + throw new IllegalArgumentException("Parameter template is required and cannot be null."); + } + return service.calculateTemplateHash(this.client.apiVersion(), template, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = calculateTemplateHashDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse calculateTemplateHashDelegate(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); + } + /** * Get all the deployments for a resource group. * diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ProviderImpl.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ProviderImpl.java index e4a5ffdec2faf..331a1cbbb450f 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ProviderImpl.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ProviderImpl.java @@ -21,6 +21,7 @@ class ProviderImpl extends IndexableRefreshableWrapperImpl getAsync(String resourceProviderNamespace) { ProvidersInner client = this.inner(); return client.getAsync(resourceProviderNamespace) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public Provider call(ProviderInner inner) { - return wrapModel(inner); + public Observable call(ProviderInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Provider)wrapModel(inner)); + } } }); } diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourceGroupImpl.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourceGroupImpl.java index 14124db60cd4e..e5badb294a14b 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourceGroupImpl.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourceGroupImpl.java @@ -35,7 +35,7 @@ class ResourceGroupImpl extends CreatableUpdatableImpl checkExistenceAsync(String resourceGroupName) { ResourceGroupsInner client = this.inner(); - return client.checkExistenceAsync(resourceGroupName).toCompletable(); - } + return client.checkExistenceAsync(resourceGroupName) + ;} @Override public Observable exportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters) { @@ -84,10 +84,14 @@ public ResourceGroup call(ResourceGroupInner inner) { public Observable getAsync(String resourceGroupName) { ResourceGroupsInner client = this.inner(); return client.getAsync(resourceGroupName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public ResourceGroup call(ResourceGroupInner inner) { - return wrapModel(inner); + public Observable call(ResourceGroupInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ResourceGroup)wrapModel(inner)); + } } }); } diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourceManagementClientImpl.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourceManagementClientImpl.java index 1ca867bc55a3b..acec4803ee679 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourceManagementClientImpl.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourceManagementClientImpl.java @@ -63,11 +63,11 @@ public String apiVersion() { return this.apiVersion; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +76,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +86,11 @@ public ResourceManagementClientImpl withAcceptLanguage(String acceptLanguage) { return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +99,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +109,11 @@ public ResourceManagementClientImpl withLongRunningOperationRetryTimeout(int lon return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -122,7 +122,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -261,6 +261,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ResourceManagementClient", "2018-02-01"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ResourceManagementClient", "2018-02-01"); } } diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesImpl.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesImpl.java index 7d31838c0946d..5ddd1482d32db 100644 --- a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesImpl.java +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesImpl.java @@ -53,10 +53,10 @@ public GenericResource call(GenericResourceInner inner) { } @Override - public Completable checkExistenceByIdAsync(String resourceId, String apiVersion) { + public Observable checkExistenceByIdAsync(String resourceId, String apiVersion) { ResourcesInner client = this.inner(); - return client.checkExistenceByIdAsync(resourceId, apiVersion).toCompletable(); - } + return client.checkExistenceByIdAsync(resourceId, apiVersion) + ;} @Override public Completable deleteByIdAsync(String resourceId, String apiVersion) { @@ -131,10 +131,10 @@ public Completable validateMoveResourcesAsync(String sourceResourceGroupName, Re } @Override - public Completable checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + public Observable checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { ResourcesInner client = this.inner(); - return client.checkExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toCompletable(); - } + return client.checkExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion) + ;} @Override public Completable deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TemplateHashResultImpl.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TemplateHashResultImpl.java new file mode 100644 index 0000000000000..7efd417280f34 --- /dev/null +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TemplateHashResultImpl.java @@ -0,0 +1,36 @@ +/** + * 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.resources.v2018_02_01.implementation; + +import com.microsoft.azure.management.resources.v2018_02_01.TemplateHashResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TemplateHashResultImpl extends WrapperImpl implements TemplateHashResult { + private final ResourcesManager manager; + TemplateHashResultImpl(TemplateHashResultInner inner, ResourcesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ResourcesManager manager() { + return this.manager; + } + + @Override + public String minifiedTemplate() { + return this.inner().minifiedTemplate(); + } + + @Override + public String templateHash() { + return this.inner().templateHash(); + } + +} diff --git a/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TemplateHashResultInner.java b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TemplateHashResultInner.java new file mode 100644 index 0000000000000..daa4f8b62bd2b --- /dev/null +++ b/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TemplateHashResultInner.java @@ -0,0 +1,70 @@ +/** + * 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.resources.v2018_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of the request to calculate template hash. It contains a string of + * minified template and its hash. + */ +public class TemplateHashResultInner { + /** + * The minified template string. + */ + @JsonProperty(value = "minifiedTemplate") + private String minifiedTemplate; + + /** + * The template hash. + */ + @JsonProperty(value = "templateHash") + private String templateHash; + + /** + * Get the minified template string. + * + * @return the minifiedTemplate value + */ + public String minifiedTemplate() { + return this.minifiedTemplate; + } + + /** + * Set the minified template string. + * + * @param minifiedTemplate the minifiedTemplate value to set + * @return the TemplateHashResultInner object itself. + */ + public TemplateHashResultInner withMinifiedTemplate(String minifiedTemplate) { + this.minifiedTemplate = minifiedTemplate; + return this; + } + + /** + * Get the template hash. + * + * @return the templateHash value + */ + public String templateHash() { + return this.templateHash; + } + + /** + * Set the template hash. + * + * @param templateHash the templateHash value to set + * @return the TemplateHashResultInner object itself. + */ + public TemplateHashResultInner withTemplateHash(String templateHash) { + this.templateHash = templateHash; + return this; + } + +}