From e10d160aefd7cea33d5433bb0dcdb55f39b44da3 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 16 Dec 2019 18:14:53 +0000 Subject: [PATCH] Generated from ca54be28788f28d675922ac12b6ebde2fe90c224 Add error property to ScriptStatus --- sdk/resources/mgmt-v2019_05_01/pom.xml | 4 +- .../v2019_05_01/DeploymentExtended.java | 8 +- .../resources/v2019_05_01/Deployments.java | 21 ++++- .../v2019_05_01/ErrorAdditionalInfo.java | 47 ++++++++++ .../resources/v2019_05_01/ErrorResponse.java | 93 +++++++++++++++++++ .../v2019_05_01/TemplateHashResult.java | 30 ++++++ .../DeploymentExtendedImpl.java | 2 +- .../implementation/DeploymentsImpl.java | 27 ++++-- .../implementation/DeploymentsInner.java | 80 ++++++++++++++++ .../TemplateHashResultImpl.java | 36 +++++++ .../TemplateHashResultInner.java | 70 ++++++++++++++ 11 files changed, 400 insertions(+), 18 deletions(-) create mode 100644 sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/ErrorAdditionalInfo.java create mode 100644 sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/ErrorResponse.java create mode 100644 sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/TemplateHashResult.java create mode 100644 sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TemplateHashResultImpl.java create mode 100644 sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TemplateHashResultInner.java diff --git a/sdk/resources/mgmt-v2019_05_01/pom.xml b/sdk/resources/mgmt-v2019_05_01/pom.xml index e1bcbbeee585b..564358d17680f 100644 --- a/sdk/resources/mgmt-v2019_05_01/pom.xml +++ b/sdk/resources/mgmt-v2019_05_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../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. diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/DeploymentExtended.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/DeploymentExtended.java index 732f08c5e8754..abf1085c30e63 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/DeploymentExtended.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/DeploymentExtended.java @@ -49,7 +49,7 @@ public interface DeploymentExtended extends HasInner, I /** * The entirety of the DeploymentExtended definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMicrosoftResource, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMicrosoft.Resource, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -59,19 +59,19 @@ interface DefinitionStages { /** * The first stage of a DeploymentExtended definition. */ - interface Blank extends WithMicrosoftResource { + interface Blank extends WithMicrosoft.Resource { } /** * The stage of the deploymentextended definition allowing to specify Microsoft.Resource. */ - interface WithMicrosoftResource { + interface WithMicrosoft.Resource { /** * Specifies groupId. * @param groupId The management group ID * @return the next definition stage */ - WithProperties withExistingMicrosoftResource(String groupId); + WithProperties withExistingMicrosoft.Resource(String groupId); } /** diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/Deployments.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/Deployments.java index ce14968c3756f..851fadc89224e 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/Deployments.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/Deployments.java @@ -8,17 +8,21 @@ package com.microsoft.azure.management.resources.v2019_05_01; -import com.microsoft.azure.arm.collection.SupportsCreating; import rx.Completable; import rx.Observable; import com.microsoft.azure.management.resources.v2019_05_01.implementation.DeploymentInner; -import com.microsoft.azure.management.resources.v2019_05_01.implementation.DeploymentsInner; -import com.microsoft.azure.arm.model.HasInner; /** * Type representing Deployments. */ -public interface Deployments extends SupportsCreating, HasInner { +public interface Deployments { + /** + * Begins definition for a new Deployment resource. + * @param name resource name. + * @return the first stage of the new Deployment definition. + */ + DeploymentExtended.DefinitionStages.Blank defineDeployment(String name); + /** * Deletes a deployment from the deployment history. * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code. @@ -251,4 +255,13 @@ public interface Deployments extends SupportsCreating listByResourceGroupAsync(final String resourceGroupName); + /** + * 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/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/ErrorAdditionalInfo.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..4199cedbaeb0e --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_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.v2019_05_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/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/ErrorResponse.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/ErrorResponse.java new file mode 100644 index 0000000000000..e1f582736269c --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_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.v2019_05_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/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/TemplateHashResult.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/TemplateHashResult.java new file mode 100644 index 0000000000000..e67d5f75ecc0d --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_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.v2019_05_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.resources.v2019_05_01.implementation.ResourcesManager; +import com.microsoft.azure.management.resources.v2019_05_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/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentExtendedImpl.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentExtendedImpl.java index ea34e06a1eb67..6d33270840600 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentExtendedImpl.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentExtendedImpl.java @@ -116,7 +116,7 @@ public String type() { } @Override - public DeploymentExtendedImpl withExistingMicrosoftResource(String groupId) { + public DeploymentExtendedImpl withExistingMicrosoft.Resource(String groupId) { this.groupId = groupId; return this; } diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentsImpl.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentsImpl.java index 0d1f0b0c784bb..3c897564ba508 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentsImpl.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentsImpl.java @@ -4,7 +4,7 @@ * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * + * abc */ package com.microsoft.azure.management.resources.v2019_05_01.implementation; @@ -18,6 +18,7 @@ import com.microsoft.azure.management.resources.v2019_05_01.DeploymentExtended; import com.microsoft.azure.management.resources.v2019_05_01.DeploymentValidateResult; import com.microsoft.azure.management.resources.v2019_05_01.DeploymentExportResult; +import com.microsoft.azure.management.resources.v2019_05_01.TemplateHashResult; class DeploymentsImpl extends WrapperImpl implements Deployments { private final ResourcesManager manager; @@ -32,16 +33,16 @@ public ResourcesManager manager() { } @Override - public DeploymentExtendedImpl define(String name) { - return wrapModel(name); + public DeploymentExtendedImpl defineDeployment(String name) { + return wrapDeploymentModel(name); } - private DeploymentExtendedImpl wrapModel(DeploymentExtendedInner inner) { - return new DeploymentExtendedImpl(inner, manager()); + private DeploymentExtendedImpl wrapDeploymentModel(String name) { + return new DeploymentExtendedImpl(name, this.manager()); } - private DeploymentExtendedImpl wrapModel(String name) { - return new DeploymentExtendedImpl(name, this.manager()); + private DeploymentExtendedImpl wrapDeploymentExtendedModel(DeploymentExtendedInner inner) { + return new DeploymentExtendedImpl(inner, manager()); } @Override @@ -284,4 +285,16 @@ public DeploymentExtended call(DeploymentExtendedInner 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()); + } + }); + } + } diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentsInner.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentsInner.java index 448512a65bc0a..f3fa9d2513828 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentsInner.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/DeploymentsInner.java @@ -186,6 +186,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.v2019_05_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.v2019_05_01.Deployments listAtManagementGroupScopeNext" }) @GET Observable> listAtManagementGroupScopeNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -3148,6 +3152,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 management group. * diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TemplateHashResultImpl.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TemplateHashResultImpl.java new file mode 100644 index 0000000000000..27125df1df1eb --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_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.v2019_05_01.implementation; + +import com.microsoft.azure.management.resources.v2019_05_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/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TemplateHashResultInner.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TemplateHashResultInner.java new file mode 100644 index 0000000000000..049bcc4f06e44 --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_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.v2019_05_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; + } + +}