diff --git a/sdk/resources/mgmt-v2019_05_01/pom.xml b/sdk/resources/mgmt-v2019_05_01/pom.xml index 38779d68e17a..564358d17680 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 - ../../parents/azure-arm-parent + 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 732f08c5e875..abf1085c30e6 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 ce14968c3756..851fadc89224 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 000000000000..4199cedbaeb0 --- /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 000000000000..08d1aedd6e12 --- /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,96 @@ +/** + * 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; + +/** + * Error Response. + * Common error response for all Azure Resource Manager APIs to return error + * details for failed operations. (This also follows the OData error response + * format.). + */ +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/GenericResource.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/GenericResource.java index f7d33bd3217f..6f54818b468a 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/GenericResource.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/GenericResource.java @@ -9,9 +9,9 @@ package com.microsoft.azure.management.resources.v2019_05_01; import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.resources.v2019_05_01.implementation.GenericResourceInner; 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.GenericResourceInner; import java.util.Map; /** diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/GenericResourceExpanded.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/GenericResourceExpanded.java new file mode 100644 index 000000000000..d062025c42a4 --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/GenericResourceExpanded.java @@ -0,0 +1,92 @@ +/** + * 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.management.resources.v2019_05_01.implementation.GenericResourceExpandedInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.resources.v2019_05_01.implementation.ResourcesManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing GenericResourceExpanded. + */ +public interface GenericResourceExpanded extends HasInner, HasManager { + /** + * @return the changedTime value. + */ + DateTime changedTime(); + + /** + * @return the createdTime value. + */ + DateTime createdTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the managedBy value. + */ + String managedBy(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the plan value. + */ + Plan plan(); + + /** + * @return the properties value. + */ + Object properties(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/Resources.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/Resources.java index 508f7cdf7ac2..9e45ef076307 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/Resources.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/Resources.java @@ -24,7 +24,7 @@ public interface Resources extends HasInner { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable listAsync(); + Observable listAsync(); /** * Checks by ID whether a resource exists. @@ -85,7 +85,7 @@ public interface Resources extends HasInner { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable listByResourceGroupAsync(final String resourceGroupName); + Observable listByResourceGroupAsync(final String resourceGroupName); /** * Moves resources from one resource group to another resource group. diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/TagOperations.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/TagOperations.java new file mode 100644 index 000000000000..2bb66016d0f2 --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/TagOperations.java @@ -0,0 +1,67 @@ +/** + * 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 rx.Observable; +import com.microsoft.azure.management.resources.v2019_05_01.TagDetails; +import rx.Completable; + +/** + * Type representing TagOperations. + */ +public interface TagOperations { + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Deletes a tag from the subscription. + * You must remove all values from a resource tag before you can delete it. + * + * @param tagName The name of the tag. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String tagName); + + /** + * Creates a tag in the subscription. + * The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes. + * + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String tagName); + + /** + * Deletes a tag value. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteValueAsync(String tagName, String tagValue); + + /** + * Creates a tag value. The name of the tag must already exist. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateValueAsync(String tagName, String tagValue); + +} 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 000000000000..e67d5f75ecc0 --- /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 ea34e06a1eb6..6d3327084060 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 0d1f0b0c784b..3c897564ba50 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 448512a65bc0..f3fa9d251382 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/GenericResourceExpandedImpl.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceExpandedImpl.java new file mode 100644 index 000000000000..c1e774c26f9a --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceExpandedImpl.java @@ -0,0 +1,105 @@ +/** + * 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.GenericResourceExpanded; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.resources.v2019_05_01.Identity; +import com.microsoft.azure.management.resources.v2019_05_01.Plan; +import com.microsoft.azure.management.resources.v2019_05_01.Sku; +import java.util.Map; + +class GenericResourceExpandedImpl extends WrapperImpl implements GenericResourceExpanded { + private final ResourcesManager manager; + + GenericResourceExpandedImpl(GenericResourceExpandedInner inner, ResourcesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ResourcesManager manager() { + return this.manager; + } + + + + @Override + public DateTime changedTime() { + return this.inner().changedTime(); + } + + @Override + public DateTime createdTime() { + return this.inner().createdTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String managedBy() { + return this.inner().managedBy(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Plan plan() { + return this.inner().plan(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceExpandedInner.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceExpandedInner.java new file mode 100644 index 000000000000..5b9efe828069 --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceExpandedInner.java @@ -0,0 +1,66 @@ +/** + * 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 org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource information. + */ +public class GenericResourceExpandedInner extends GenericResourceInner { + /** + * The created time of the resource. This is only present if requested via + * the $expand query parameter. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdTime; + + /** + * The changed time of the resource. This is only present if requested via + * the $expand query parameter. + */ + @JsonProperty(value = "changedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime changedTime; + + /** + * The provisioning state of the resource. This is only present if + * requested via the $expand query parameter. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the created time of the resource. This is only present if requested via the $expand query parameter. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Get the changed time of the resource. This is only present if requested via the $expand query parameter. + * + * @return the changedTime value + */ + public DateTime changedTime() { + return this.changedTime; + } + + /** + * Get the provisioning state of the resource. This is only present if requested via the $expand query parameter. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceImpl.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceImpl.java index 6bbd3517297b..6461274686e5 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceImpl.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/GenericResourceImpl.java @@ -10,7 +10,6 @@ import com.microsoft.azure.management.resources.v2019_05_01.GenericResource; import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import rx.Observable; import com.microsoft.azure.management.resources.v2019_05_01.Identity; import com.microsoft.azure.management.resources.v2019_05_01.Plan; import com.microsoft.azure.management.resources.v2019_05_01.Sku; @@ -18,8 +17,7 @@ class GenericResourceImpl extends WrapperImpl implements GenericResource { private final ResourcesManager manager; - - GenericResourceImpl(GenericResourceInner inner, ResourcesManager manager) { + GenericResourceImpl(GenericResourceInner inner, ResourcesManager manager) { super(inner); this.manager = manager; } @@ -29,8 +27,6 @@ public ResourcesManager manager() { return this.manager; } - - @Override public String id() { return this.inner().id(); diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourceManagementClientImpl.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourceManagementClientImpl.java index 2f10297d535b..43dacd32a37e 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourceManagementClientImpl.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourceManagementClientImpl.java @@ -198,16 +198,16 @@ public ResourceGroupsInner resourceGroups() { } /** - * The TagsInner object to access its operations. + * The TagOperationsInner object to access its operations. */ - private TagsInner tags; + private TagOperationsInner tagOperations; /** - * Gets the TagsInner object to access its operations. - * @return the TagsInner object. + * Gets the TagOperationsInner object to access its operations. + * @return the TagOperationsInner object. */ - public TagsInner tags() { - return this.tags; + public TagOperationsInner tagOperations() { + return this.tagOperations; } /** @@ -263,7 +263,7 @@ protected void initialize() { this.providers = new ProvidersInner(restClient().retrofit(), this); this.resources = new ResourcesInner(restClient().retrofit(), this); this.resourceGroups = new ResourceGroupsInner(restClient().retrofit(), this); - this.tags = new TagsInner(restClient().retrofit(), this); + this.tagOperations = new TagOperationsInner(restClient().retrofit(), this); this.deploymentOperations = new DeploymentOperationsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesImpl.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesImpl.java index 4d462d6c2d63..03030c813a0e 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesImpl.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesImpl.java @@ -15,6 +15,7 @@ import rx.functions.Func1; import com.microsoft.azure.Page; import rx.Completable; +import com.microsoft.azure.management.resources.v2019_05_01.GenericResourceExpanded; import com.microsoft.azure.management.resources.v2019_05_01.GenericResource; import com.microsoft.azure.management.resources.v2019_05_01.ResourcesMoveInfo; @@ -30,24 +31,24 @@ public ResourcesManager manager() { return this.manager; } - private GenericResourceImpl wrapModel(GenericResourceInner inner) { - return new GenericResourceImpl(inner, manager()); + private GenericResourceExpandedImpl wrapModel(GenericResourceExpandedInner inner) { + return new GenericResourceExpandedImpl(inner, manager()); } @Override - public Observable listAsync() { + public Observable listAsync() { ResourcesInner client = this.inner(); return client.listAsync() - .flatMapIterable(new Func1, Iterable>() { + .flatMapIterable(new Func1, Iterable>() { @Override - public Iterable call(Page page) { + public Iterable call(Page page) { return page.items(); } }) - .map(new Func1() { + .map(new Func1() { @Override - public GenericResource call(GenericResourceInner inner) { - return new GenericResourceImpl(inner, manager()); + public GenericResourceExpanded call(GenericResourceExpandedInner inner) { + return new GenericResourceExpandedImpl(inner, manager()); } }); } @@ -101,18 +102,18 @@ public GenericResource call(GenericResourceInner inner) { } @Override - public Observable listByResourceGroupAsync(final String resourceGroupName) { + public Observable listByResourceGroupAsync(final String resourceGroupName) { ResourcesInner client = this.inner(); return client.listByResourceGroupAsync(resourceGroupName) - .flatMapIterable(new Func1, Iterable>() { + .flatMapIterable(new Func1, Iterable>() { @Override - public Iterable call(Page page) { + public Iterable call(Page page) { return page.items(); } }) - .map(new Func1() { + .map(new Func1() { @Override - public GenericResource call(GenericResourceInner inner) { + public GenericResourceExpanded call(GenericResourceExpandedInner inner) { return wrapModel(inner); } }); diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesInner.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesInner.java index a15611b84122..6904fc78cf39 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesInner.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesInner.java @@ -44,7 +44,7 @@ * An instance of this class provides access to all the operations defined * in Resources. */ -public class ResourcesInner implements InnerSupportsListing { +public class ResourcesInner implements InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private ResourcesService service; /** The service client containing this operation class. */ @@ -171,13 +171,13 @@ interface ResourcesService { * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<GenericResourceInner> object if successful. + * @return the PagedList<GenericResourceExpandedInner> object if successful. */ - public PagedList listByResourceGroup(final String resourceGroupName) { - ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; @@ -191,12 +191,12 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listByResourceGroupSinglePageAsync(resourceGroupName), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, @@ -208,13 +208,13 @@ public Observable>> call(String nextP * * @param resourceGroupName The resource group with the resources to get. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceExpandedInner> object */ - public Observable> listByResourceGroupAsync(final String resourceGroupName) { + public Observable> listByResourceGroupAsync(final String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName) - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); @@ -225,13 +225,13 @@ public Page call(ServiceResponse>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { return listByResourceGroupSinglePageAsync(resourceGroupName) - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -246,9 +246,9 @@ public Observable>> call(ServiceRespo * * @param resourceGroupName The resource group with the resources to get. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -262,12 +262,12 @@ public Observable>> listByResourceGro final String expand = null; final Integer top = null; return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, expand, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -280,18 +280,18 @@ public Observable>> call(Response listByResourceGroup(final String resourceGroupName, final String filter, final String expand, final Integer top) { - ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final String expand, final Integer top) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; @@ -302,18 +302,18 @@ public Page nextPage(String nextPageLink) { * * @param resourceGroupName The resource group with the resources to get. * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. - * @param expand The $expand query parameter. You can expand createdTime and changedTime. For example, to expand both properties, use $expand=changedTime,createdTime + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. * @param top The number of results to return. If null is passed, returns all resources. * @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> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final Integer top, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final Integer top, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, @@ -325,16 +325,16 @@ public Observable>> call(String nextP * * @param resourceGroupName The resource group with the resources to get. * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. - * @param expand The $expand query parameter. You can expand createdTime and changedTime. For example, to expand both properties, use $expand=changedTime,createdTime + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. * @param top The number of results to return. If null is passed, returns all resources. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceExpandedInner> object */ - public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, expand, top) - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); @@ -345,16 +345,16 @@ public Page call(ServiceResponse>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { return listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top) - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -367,14 +367,14 @@ public Observable>> call(ServiceRespo /** * Get all the resources for a resource group. * - ServiceResponse> * @param resourceGroupName The resource group with the resources to get. - ServiceResponse> * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. - ServiceResponse> * @param expand The $expand query parameter. You can expand createdTime and changedTime. For example, to expand both properties, use $expand=changedTime,createdTime - ServiceResponse> * @param top The number of results to return. If null is passed, returns all resources. + ServiceResponse> * @param resourceGroupName The resource group with the resources to get. + ServiceResponse> * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. + ServiceResponse> * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + ServiceResponse> * @param top The number of results to return. If null is passed, returns all resources. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -385,12 +385,12 @@ public Observable>> listByResourceGro throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, expand, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -398,9 +398,9 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -740,13 +740,13 @@ private ServiceResponse beginValidateMoveResourcesDelegate(Response list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; @@ -759,12 +759,12 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listSinglePageAsync(), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, @@ -775,13 +775,13 @@ public Observable>> call(String nextP * Get all the resources in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceExpandedInner> object */ - public Observable> listAsync() { + public Observable> listAsync() { return listWithServiceResponseAsync() - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); @@ -791,13 +791,13 @@ public Page call(ServiceResponse>> listWithServiceResponseAsync() { + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -811,9 +811,9 @@ public Observable>> call(ServiceRespo * Get all the resources in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync() { + public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -824,12 +824,12 @@ public Observable>> listSinglePageAsy final String expand = null; final Integer top = null; return service.list(this.client.subscriptionId(), filter, expand, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -841,18 +841,18 @@ public Observable>> call(Response list(final String filter, final String expand, final Integer top) { - ServiceResponse> response = listSinglePageAsync(filter, expand, top).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList list(final String filter, final String expand, final Integer top) { + ServiceResponse> response = listSinglePageAsync(filter, expand, top).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; @@ -862,18 +862,18 @@ public Page nextPage(String nextPageLink) { * Get all the resources in a subscription. * * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. - * @param expand The $expand query parameter. You can expand createdTime and changedTime. For example, to expand both properties, use $expand=changedTime,createdTime + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. * @param top The number of results to return. If null is passed, returns all resource groups. * @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> listAsync(final String filter, final String expand, final Integer top, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAsync(final String filter, final String expand, final Integer top, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listSinglePageAsync(filter, expand, top), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, @@ -884,16 +884,16 @@ public Observable>> call(String nextP * Get all the resources in a subscription. * * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. - * @param expand The $expand query parameter. You can expand createdTime and changedTime. For example, to expand both properties, use $expand=changedTime,createdTime + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. * @param top The number of results to return. If null is passed, returns all resource groups. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceExpandedInner> object */ - public Observable> listAsync(final String filter, final String expand, final Integer top) { + public Observable> listAsync(final String filter, final String expand, final Integer top) { return listWithServiceResponseAsync(filter, expand, top) - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); @@ -903,16 +903,16 @@ public Page call(ServiceResponse>> listWithServiceResponseAsync(final String filter, final String expand, final Integer top) { + public Observable>> listWithServiceResponseAsync(final String filter, final String expand, final Integer top) { return listSinglePageAsync(filter, expand, top) - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -925,13 +925,13 @@ public Observable>> call(ServiceRespo /** * Get all the resources in a subscription. * - ServiceResponse> * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. - ServiceResponse> * @param expand The $expand query parameter. You can expand createdTime and changedTime. For example, to expand both properties, use $expand=changedTime,createdTime - ServiceResponse> * @param top The number of results to return. If null is passed, returns all resource groups. + ServiceResponse> * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)<br><br>You can link more than one substringof together by adding and/or operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'<br><br>You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. + ServiceResponse> * @param expand Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + ServiceResponse> * @param top The number of results to return. If null is passed, returns all resource groups. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync(final String filter, final String expand, final Integer top) { + public Observable>> listSinglePageAsync(final String filter, final String expand, final Integer top) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -939,12 +939,12 @@ public Observable>> listSinglePageAsy throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.list(this.client.subscriptionId(), filter, expand, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -952,9 +952,9 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -2464,13 +2464,13 @@ private ServiceResponse getByIdDelegate(Response listByResourceGroupNext(final String nextPageLink) { - ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; @@ -2485,12 +2485,12 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listByResourceGroupNextSinglePageAsync(nextPageLink), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, @@ -2502,13 +2502,13 @@ public Observable>> call(String nextP * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceExpandedInner> object */ - public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); @@ -2519,13 +2519,13 @@ public Page call(ServiceResponse>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -2538,22 +2538,22 @@ public Observable>> call(ServiceRespo /** * Get all the resources for a resource group. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2561,9 +2561,9 @@ public Observable>> call(Response> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -2575,13 +2575,13 @@ private ServiceResponse> listByResourceGroupNextD * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<GenericResourceInner> object if successful. + * @return the PagedList<GenericResourceExpandedInner> object if successful. */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; @@ -2596,12 +2596,12 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listNextSinglePageAsync(nextPageLink), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, @@ -2613,13 +2613,13 @@ public Observable>> call(String nextP * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceExpandedInner> object */ - public Observable> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); @@ -2630,13 +2630,13 @@ public Page call(ServiceResponse>> listNextWithServiceResponseAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -2649,22 +2649,22 @@ public Observable>> call(ServiceRespo /** * Get all the resources in a subscription. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceExpandedInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { + public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2672,9 +2672,9 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesManager.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesManager.java index 47d174abaff9..6d6a502f01e5 100644 --- a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesManager.java +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/ResourcesManager.java @@ -21,7 +21,7 @@ import com.microsoft.azure.management.resources.v2019_05_01.Providers; import com.microsoft.azure.management.resources.v2019_05_01.Resources; import com.microsoft.azure.management.resources.v2019_05_01.ResourceGroups; -import com.microsoft.azure.management.resources.v2019_05_01.Tags; +import com.microsoft.azure.management.resources.v2019_05_01.TagOperations; import com.microsoft.azure.management.resources.v2019_05_01.DeploymentOperations; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -35,7 +35,7 @@ public final class ResourcesManager extends ManagerCore implements TagOperations { + private final ResourcesManager manager; + + TagOperationsImpl(ResourcesManager manager) { + super(manager.inner().tagOperations()); + this.manager = manager; + } + + public ResourcesManager manager() { + return this.manager; + } + + private TagDetailsImpl wrapTagDetailsModel(TagDetailsInner inner) { + return new TagDetailsImpl(inner, manager()); + } + + @Override + public Observable listAsync() { + TagOperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public TagDetails call(TagDetailsInner inner) { + return wrapTagDetailsModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String tagName) { + TagOperationsInner client = this.inner(); + return client.deleteAsync(tagName).toCompletable(); + } + + @Override + public Observable createOrUpdateAsync(String tagName) { + TagOperationsInner client = this.inner(); + return client.createOrUpdateAsync(tagName) + .map(new Func1() { + @Override + public TagDetails call(TagDetailsInner inner) { + return new TagDetailsImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteValueAsync(String tagName, String tagValue) { + TagOperationsInner client = this.inner(); + return client.deleteValueAsync(tagName, tagValue).toCompletable(); + } + + @Override + public Observable createOrUpdateValueAsync(String tagName, String tagValue) { + TagOperationsInner client = this.inner(); + return client.createOrUpdateValueAsync(tagName, tagValue) + .map(new Func1() { + @Override + public TagValue call(TagValueInner inner) { + return new TagValueImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TagOperationsInner.java b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TagOperationsInner.java new file mode 100644 index 000000000000..232ac3a8b267 --- /dev/null +++ b/sdk/resources/mgmt-v2019_05_01/src/main/java/com/microsoft/azure/management/resources/v2019_05_01/implementation/TagOperationsInner.java @@ -0,0 +1,646 @@ +/** + * 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 retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in TagOperations. + */ +public class TagOperationsInner { + /** The Retrofit service to perform REST calls. */ + private TagOperationsService service; + /** The service client containing this operation class. */ + private ResourceManagementClientImpl client; + + /** + * Initializes an instance of TagOperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TagOperationsInner(Retrofit retrofit, ResourceManagementClientImpl client) { + this.service = retrofit.create(TagOperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for TagOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface TagOperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2019_05_01.TagOperations deleteValue" }) + @HTTP(path = "subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", method = "DELETE", hasBody = true) + Observable> deleteValue(@Path("tagName") String tagName, @Path("tagValue") String tagValue, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2019_05_01.TagOperations createOrUpdateValue" }) + @PUT("subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}") + Observable> createOrUpdateValue(@Path("tagName") String tagName, @Path("tagValue") String tagValue, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2019_05_01.TagOperations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/tagNames/{tagName}") + Observable> createOrUpdate(@Path("tagName") String tagName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2019_05_01.TagOperations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/tagNames/{tagName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("tagName") String tagName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2019_05_01.TagOperations list" }) + @GET("subscriptions/{subscriptionId}/tagNames") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2019_05_01.TagOperations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes a tag value. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @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 + */ + public void deleteValue(String tagName, String tagValue) { + deleteValueWithServiceResponseAsync(tagName, tagValue).toBlocking().single().body(); + } + + /** + * Deletes a tag value. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @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 deleteValueAsync(String tagName, String tagValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteValueWithServiceResponseAsync(tagName, tagValue), serviceCallback); + } + + /** + * Deletes a tag value. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteValueAsync(String tagName, String tagValue) { + return deleteValueWithServiceResponseAsync(tagName, tagValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a tag value. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteValueWithServiceResponseAsync(String tagName, String tagValue) { + if (tagName == null) { + throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); + } + if (tagValue == null) { + throw new IllegalArgumentException("Parameter tagValue is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteValue(tagName, tagValue, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteValueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteValueDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a tag value. The name of the tag must already exist. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @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 TagValueInner object if successful. + */ + public TagValueInner createOrUpdateValue(String tagName, String tagValue) { + return createOrUpdateValueWithServiceResponseAsync(tagName, tagValue).toBlocking().single().body(); + } + + /** + * Creates a tag value. The name of the tag must already exist. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @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 createOrUpdateValueAsync(String tagName, String tagValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateValueWithServiceResponseAsync(tagName, tagValue), serviceCallback); + } + + /** + * Creates a tag value. The name of the tag must already exist. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TagValueInner object + */ + public Observable createOrUpdateValueAsync(String tagName, String tagValue) { + return createOrUpdateValueWithServiceResponseAsync(tagName, tagValue).map(new Func1, TagValueInner>() { + @Override + public TagValueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a tag value. The name of the tag must already exist. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TagValueInner object + */ + public Observable> createOrUpdateValueWithServiceResponseAsync(String tagName, String tagValue) { + if (tagName == null) { + throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); + } + if (tagValue == null) { + throw new IllegalArgumentException("Parameter tagValue is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.createOrUpdateValue(tagName, tagValue, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateValueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateValueDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a tag in the subscription. + * The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes. + * + * @param tagName The name of the tag to create. + * @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 TagDetailsInner object if successful. + */ + public TagDetailsInner createOrUpdate(String tagName) { + return createOrUpdateWithServiceResponseAsync(tagName).toBlocking().single().body(); + } + + /** + * Creates a tag in the subscription. + * The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes. + * + * @param tagName The name of the tag to create. + * @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 createOrUpdateAsync(String tagName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(tagName), serviceCallback); + } + + /** + * Creates a tag in the subscription. + * The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes. + * + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TagDetailsInner object + */ + public Observable createOrUpdateAsync(String tagName) { + return createOrUpdateWithServiceResponseAsync(tagName).map(new Func1, TagDetailsInner>() { + @Override + public TagDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a tag in the subscription. + * The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes. + * + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TagDetailsInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String tagName) { + if (tagName == null) { + throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.createOrUpdate(tagName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a tag from the subscription. + * You must remove all values from a resource tag before you can delete it. + * + * @param tagName The name of the tag. + * @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 + */ + public void delete(String tagName) { + deleteWithServiceResponseAsync(tagName).toBlocking().single().body(); + } + + /** + * Deletes a tag from the subscription. + * You must remove all values from a resource tag before you can delete it. + * + * @param tagName The name of the tag. + * @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 deleteAsync(String tagName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(tagName), serviceCallback); + } + + /** + * Deletes a tag from the subscription. + * You must remove all values from a resource tag before you can delete it. + * + * @param tagName The name of the tag. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String tagName) { + return deleteWithServiceResponseAsync(tagName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a tag from the subscription. + * You must remove all values from a resource tag before you can delete it. + * + * @param tagName The name of the tag. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String tagName) { + if (tagName == null) { + throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(tagName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TagDetailsInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TagDetailsInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TagDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TagDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TagDetailsInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TagDetailsInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TagDetailsInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TagDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/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 000000000000..27125df1df1e --- /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 000000000000..049bcc4f06e4 --- /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; + } + +}