diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ExportTemplateRequest.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ExportTemplateRequest.java new file mode 100644 index 00000000000..eab6f97270c --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ExportTemplateRequest.java @@ -0,0 +1,74 @@ +/** + * 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; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Export resource group template request parameters. + */ +public class ExportTemplateRequest { + /** + * The IDs of the resources. The only supported string currently is '*' + * (all resources). Future updates will support exporting specific + * resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * The export template options. Supported values include + * 'IncludeParameterDefaultValue', 'IncludeComments' or + * 'IncludeParameterDefaultValue, IncludeComments. + */ + @JsonProperty(value = "options") + private String options; + + /** + * Get the resources value. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources value. + * + * @param resources the resources value to set + * @return the ExportTemplateRequest object itself. + */ + public ExportTemplateRequest withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Get the options value. + * + * @return the options value + */ + public String options() { + return this.options; + } + + /** + * Set the options value. + * + * @param options the options value to set + * @return the ExportTemplateRequest object itself. + */ + public ExportTemplateRequest withOptions(String options) { + this.options = options; + return this; + } + +} diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesMoveInfo.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesMoveInfo.java new file mode 100644 index 00000000000..fd1efee658e --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourcesMoveInfo.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; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters of move resources. + */ +public class ResourcesMoveInfo { + /** + * The IDs of the resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * The target resource group. + */ + @JsonProperty(value = "targetResourceGroup") + private String targetResourceGroup; + + /** + * Get the resources value. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources value. + * + * @param resources the resources value to set + * @return the ResourcesMoveInfo object itself. + */ + public ResourcesMoveInfo withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Get the targetResourceGroup value. + * + * @return the targetResourceGroup value + */ + public String targetResourceGroup() { + return this.targetResourceGroup; + } + + /** + * Set the targetResourceGroup value. + * + * @param targetResourceGroup the targetResourceGroup value to set + * @return the ResourcesMoveInfo object itself. + */ + public ResourcesMoveInfo withTargetResourceGroup(String targetResourceGroup) { + this.targetResourceGroup = targetResourceGroup; + return this; + } + +} diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourceInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourceInner.java index b43c4f0e5a8..f67752c38fa 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourceInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourceInner.java @@ -12,11 +12,13 @@ import com.microsoft.azure.management.resources.Sku; import com.microsoft.azure.management.resources.Identity; import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Resource information. */ +@SkipParentValidation public class GenericResourceInner extends Resource { /** * The plan of the resource. diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentInner.java index c098301f404..17c407dc4b4 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentInner.java @@ -8,6 +8,8 @@ package com.microsoft.azure.management.resources.implementation; +import java.util.List; +import com.microsoft.azure.management.resources.PolicySku; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -34,24 +36,54 @@ public class PolicyAssignmentInner { @JsonProperty(value = "properties.scope") private String scope; + /** + * The policy's excluded scopes. + */ + @JsonProperty(value = "properties.notScopes") + private List notScopes; + + /** + * Required if a parameter is used in policy rule. + */ + @JsonProperty(value = "properties.parameters") + private Object parameters; + + /** + * This message will be part of response in case of policy violation. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The policy assignment metadata. + */ + @JsonProperty(value = "properties.metadata") + private Object metadata; + /** * The ID of the policy assignment. */ - @JsonProperty(value = "id") + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /** * The type of the policy assignment. */ - @JsonProperty(value = "type") + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /** * The name of the policy assignment. */ - @JsonProperty(value = "name") + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; + /** + * The policy sku. + */ + @JsonProperty(value = "sku") + private PolicySku sku; + /** * Get the displayName value. * @@ -113,45 +145,103 @@ public PolicyAssignmentInner withScope(String scope) { } /** - * Get the id value. + * Get the notScopes value. * - * @return the id value + * @return the notScopes value */ - public String id() { - return this.id; + public List notScopes() { + return this.notScopes; } /** - * Set the id value. + * Set the notScopes value. * - * @param id the id value to set + * @param notScopes the notScopes value to set * @return the PolicyAssignmentInner object itself. */ - public PolicyAssignmentInner withId(String id) { - this.id = id; + public PolicyAssignmentInner withNotScopes(List notScopes) { + this.notScopes = notScopes; return this; } /** - * Get the type value. + * Get the parameters value. * - * @return the type value + * @return the parameters value */ - public String type() { - return this.type; + public Object parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @param parameters the parameters value to set + * @return the PolicyAssignmentInner object itself. + */ + public PolicyAssignmentInner withParameters(Object parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; } /** - * Set the type value. + * Set the description value. * - * @param type the type value to set + * @param description the description value to set * @return the PolicyAssignmentInner object itself. */ - public PolicyAssignmentInner withType(String type) { - this.type = type; + public PolicyAssignmentInner withDescription(String description) { + this.description = description; return this; } + /** + * Get the metadata value. + * + * @return the metadata value + */ + public Object metadata() { + return this.metadata; + } + + /** + * Set the metadata value. + * + * @param metadata the metadata value to set + * @return the PolicyAssignmentInner object itself. + */ + public PolicyAssignmentInner withMetadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + /** * Get the name value. * @@ -162,13 +252,22 @@ public String name() { } /** - * Set the name value. + * Get the sku value. + * + * @return the sku value + */ + public PolicySku sku() { + return this.sku; + } + + /** + * Set the sku value. * - * @param name the name value to set + * @param sku the sku value to set * @return the PolicyAssignmentInner object itself. */ - public PolicyAssignmentInner withName(String name) { - this.name = name; + public PolicyAssignmentInner withSku(PolicySku sku) { + this.sku = sku; return this; } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentsInner.java index 3e275c767ec..e9c0f2967db 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyAssignmentsInner.java @@ -13,8 +13,8 @@ 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.management.resources.ErrorResponseException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -64,15 +64,15 @@ public PolicyAssignmentsInner(Retrofit retrofit, PolicyClientImpl client) { */ interface PolicyAssignmentsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyAssignments delete" }) - @HTTP(path = "{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}", method = "DELETE", hasBody = true) + @HTTP(path = "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", method = "DELETE", hasBody = true) Observable> delete(@Path(value = "scope", encoded = true) String scope, @Path("policyAssignmentName") String policyAssignmentName, @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.PolicyAssignments create" }) - @PUT("{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}") + @PUT("{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") Observable> create(@Path(value = "scope", encoded = true) String scope, @Path("policyAssignmentName") String policyAssignmentName, @Body PolicyAssignmentInner parameters, @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.PolicyAssignments get" }) - @GET("{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}") + @GET("{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") Observable> get(@Path(value = "scope", encoded = true) String scope, @Path("policyAssignmentName") String policyAssignmentName, @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.PolicyAssignments listByResourceGroup" }) @@ -80,11 +80,11 @@ interface PolicyAssignmentsService { Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query(value = "$filter", encoded = true) String filter, @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.PolicyAssignments listForResource" }) - @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyassignments") + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments") Observable> listForResource(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @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.PolicyAssignments list" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyassignments") + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @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.PolicyAssignments deleteById" }) @@ -115,11 +115,12 @@ interface PolicyAssignmentsService { /** * Deletes a policy assignment. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy assignment is the part of its ID preceding '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment to delete. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PolicyAssignmentInner object if successful. */ @@ -129,8 +130,9 @@ public PolicyAssignmentInner delete(String scope, String policyAssignmentName) { /** * Deletes a policy assignment. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy assignment is the part of its ID preceding '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment to delete. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -142,8 +144,9 @@ public ServiceFuture deleteAsync(String scope, String pol /** * Deletes a policy assignment. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy assignment is the part of its ID preceding '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment to delete. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object @@ -159,8 +162,9 @@ public PolicyAssignmentInner call(ServiceResponse respons /** * Deletes a policy assignment. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy assignment is the part of its ID preceding '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment to delete. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object @@ -189,22 +193,23 @@ public Observable> call(Response deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) .build(response); } /** - * Creates a policy assignment. - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. + * Creates or updates a policy assignment. + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment. * @param parameters Parameters for the policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PolicyAssignmentInner object if successful. */ @@ -213,10 +218,10 @@ public PolicyAssignmentInner create(String scope, String policyAssignmentName, P } /** - * Creates a policy assignment. - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. + * Creates or updates a policy assignment. + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment. * @param parameters Parameters for the policy assignment. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -228,10 +233,10 @@ public ServiceFuture createAsync(String scope, String pol } /** - * Creates a policy assignment. - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. + * Creates or updates a policy assignment. + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment. * @param parameters Parameters for the policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -247,10 +252,10 @@ public PolicyAssignmentInner call(ServiceResponse respons } /** - * Creates a policy assignment. - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. + * Creates or updates a policy assignment. + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment. * @param parameters Parameters for the policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -284,20 +289,21 @@ public Observable> call(Response createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a policy assignment. + * Retrieves a policy assignment. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PolicyAssignmentInner object if successful. */ @@ -306,9 +312,10 @@ public PolicyAssignmentInner get(String scope, String policyAssignmentName) { } /** - * Gets a policy assignment. + * Retrieves a policy assignment. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment to get. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -319,9 +326,10 @@ public ServiceFuture getAsync(String scope, String policy } /** - * Gets a policy assignment. + * Retrieves a policy assignment. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object @@ -336,9 +344,10 @@ public PolicyAssignmentInner call(ServiceResponse respons } /** - * Gets a policy assignment. + * Retrieves a policy assignment. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param scope The scope of the policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' * @param policyAssignmentName The name of the policy assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object @@ -367,19 +376,20 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @param resourceGroupName The name of the resource group that contains policy assignments. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException 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<PolicyAssignmentInner> object if successful. */ @@ -394,7 +404,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @param resourceGroupName The name of the resource group that contains policy assignments. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -414,7 +425,8 @@ public Observable>> call(String next } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @param resourceGroupName The name of the resource group that contains policy assignments. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -431,7 +443,8 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @param resourceGroupName The name of the resource group that contains policy assignments. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -484,12 +498,13 @@ public Observable>> call(Response nextPage(String nextPageLink) { } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -525,10 +541,11 @@ public Observable>> call(String next } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<PolicyAssignmentInner> object */ @@ -543,10 +560,11 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * ServiceResponse> * @param resourceGroupName The name of the resource group that contains policy assignments. - ServiceResponse> * @param filter The filter to apply on the operation. + ServiceResponse> * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -596,23 +615,24 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException 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<PolicyAssignmentInner> object if successful. */ @@ -627,13 +647,14 @@ public Page nextPage(String nextPageLink) { } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + * @param resourceName The name of the resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -651,13 +672,14 @@ public Observable>> call(String next } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<PolicyAssignmentInner> object */ @@ -672,13 +694,14 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -745,16 +769,17 @@ public Observable>> call(Response nextPage(String nextPageLink) { } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -794,14 +820,15 @@ public Observable>> call(String next } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource path. - * @param resourceType The resource type. - * @param resourceName The name of the resource with policy assignments. - * @param filter The filter to apply on the operation. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<PolicyAssignmentInner> object */ @@ -816,14 +843,15 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - ServiceResponse> * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive. - ServiceResponse> * @param resourceProviderNamespace The namespace of the resource provider. - ServiceResponse> * @param parentResourcePath The parent resource path. - ServiceResponse> * @param resourceType The resource type. - ServiceResponse> * @param resourceName The name of the resource with policy assignments. - ServiceResponse> * @param filter The filter to apply on the operation. + ServiceResponse> * @param resourceGroupName The name of the resource group containing the resource. + ServiceResponse> * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + ServiceResponse> * @param parentResourcePath The parent resource path. Use empty string if there is none. + ServiceResponse> * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). + ServiceResponse> * @param resourceName The name of the resource. + ServiceResponse> * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -889,18 +918,19 @@ public Observable>> call(Response> listForResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listForResourceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException 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<PolicyAssignmentInner> object if successful. */ @@ -915,7 +945,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -934,7 +965,8 @@ public Observable>> call(String next } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<PolicyAssignmentInner> object @@ -950,7 +982,8 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. @@ -998,11 +1032,12 @@ public Observable>> call(Response nextPage(String nextPageLink) { } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * - * @param filter The filter to apply on the operation. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -1037,9 +1073,10 @@ public Observable>> call(String next } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * - * @param filter The filter to apply on the operation. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<PolicyAssignmentInner> object */ @@ -1054,9 +1091,10 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * - ServiceResponse> * @param filter The filter to apply on the operation. + ServiceResponse> * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -1102,20 +1141,20 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Deletes a policy assignment by ID. - * When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Deletes a policy assignment. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), '/subscriptions/{subscriptionId}' (subscription), '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' (resource). * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PolicyAssignmentInner object if successful. */ @@ -1124,10 +1163,10 @@ public PolicyAssignmentInner deleteById(String policyAssignmentId) { } /** - * Deletes a policy assignment by ID. - * When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Deletes a policy assignment. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), '/subscriptions/{subscriptionId}' (subscription), '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' (resource). * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -1137,10 +1176,10 @@ public ServiceFuture deleteByIdAsync(String policyAssignm } /** - * Deletes a policy assignment by ID. - * When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Deletes a policy assignment. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), '/subscriptions/{subscriptionId}' (subscription), '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' (resource). * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object */ @@ -1154,10 +1193,10 @@ public PolicyAssignmentInner call(ServiceResponse respons } /** - * Deletes a policy assignment by ID. - * When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Deletes a policy assignment. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), '/subscriptions/{subscriptionId}' (subscription), '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' (resource). * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object */ @@ -1182,21 +1221,22 @@ public Observable> call(Response deleteByIdDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse deleteByIdDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) .build(response); } /** - * Creates a policy assignment by ID. - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Creates or updates a policy assignment. + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope apply to all resources contained in that scope. For example, when you assign a policy to a resource group that policy applies to all resources in the group. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to create. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PolicyAssignmentInner object if successful. */ @@ -1205,10 +1245,10 @@ public PolicyAssignmentInner createById(String policyAssignmentId, PolicyAssignm } /** - * Creates a policy assignment by ID. - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Creates or updates a policy assignment. + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope apply to all resources contained in that scope. For example, when you assign a policy to a resource group that policy applies to all resources in the group. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to create. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param parameters Parameters for policy assignment. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1219,10 +1259,10 @@ public ServiceFuture createByIdAsync(String policyAssignm } /** - * Creates a policy assignment by ID. - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Creates or updates a policy assignment. + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope apply to all resources contained in that scope. For example, when you assign a policy to a resource group that policy applies to all resources in the group. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to create. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object @@ -1237,10 +1277,10 @@ public PolicyAssignmentInner call(ServiceResponse respons } /** - * Creates a policy assignment by ID. - * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Creates or updates a policy assignment. + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope apply to all resources contained in that scope. For example, when you assign a policy to a resource group that policy applies to all resources in the group. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to create. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object @@ -1270,20 +1310,20 @@ public Observable> call(Response createByIdDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createByIdDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Gets a policy assignment by ID. - * When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Retrieves the policy assignment with the given ID. + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PolicyAssignmentInner object if successful. */ @@ -1292,10 +1332,10 @@ public PolicyAssignmentInner getById(String policyAssignmentId) { } /** - * Gets a policy assignment by ID. - * When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Retrieves the policy assignment with the given ID. + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -1305,10 +1345,10 @@ public ServiceFuture getByIdAsync(String policyAssignment } /** - * Gets a policy assignment by ID. - * When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Retrieves the policy assignment with the given ID. + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object */ @@ -1322,10 +1362,10 @@ public PolicyAssignmentInner call(ServiceResponse respons } /** - * Gets a policy assignment by ID. - * When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources. + * Retrieves the policy assignment with the given ID. + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PolicyAssignmentInner object */ @@ -1350,19 +1390,20 @@ public Observable> call(Response getByIdDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getByIdDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @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 ErrorResponseException 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<PolicyAssignmentInner> object if successful. */ @@ -1377,7 +1418,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1398,7 +1440,8 @@ public Observable>> call(String next } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1415,7 +1458,8 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets policy assignments for the resource group. + * Retrieves all policy assignments that apply to a resource group. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource group and assign the policy definition whose id is {value}. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1461,19 +1506,20 @@ public Observable>> call(Response> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @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 ErrorResponseException 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<PolicyAssignmentInner> object if successful. */ @@ -1488,7 +1534,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1509,7 +1556,8 @@ public Observable>> call(String next } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1526,7 +1574,8 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets policy assignments for a resource. + * Retrieves all policy assignments that apply to a resource. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the resource and assign the policy definition whose id is {value}. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1572,19 +1622,20 @@ public Observable>> call(Response> listForResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listForResourceNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * * @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 ErrorResponseException 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<PolicyAssignmentInner> object if successful. */ @@ -1599,7 +1650,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1620,7 +1672,8 @@ public Observable>> call(String next } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1637,7 +1690,8 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets all the policy assignments for a subscription. + * Retrieves all policy assignments that apply to a subscription. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy assignments that apply to the subscription and assign the policy definition whose id is {value}. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1683,10 +1738,10 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyClientImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyClientImpl.java index ddcee842610..02944ec28ef 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyClientImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyClientImpl.java @@ -158,6 +158,19 @@ public PolicyDefinitionsInner policyDefinitions() { return this.policyDefinitions; } + /** + * The PolicySetDefinitionsInner object to access its operations. + */ + private PolicySetDefinitionsInner policySetDefinitions; + + /** + * Gets the PolicySetDefinitionsInner object to access its operations. + * @return the PolicySetDefinitionsInner object. + */ + public PolicySetDefinitionsInner policySetDefinitions() { + return this.policySetDefinitions; + } + /** * Initializes an instance of PolicyClient client. * @@ -189,12 +202,13 @@ public PolicyClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2016-04-01"; + this.apiVersion = "2018-03-01"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; this.policyAssignments = new PolicyAssignmentsInner(restClient().retrofit(), this); this.policyDefinitions = new PolicyDefinitionsInner(restClient().retrofit(), this); + this.policySetDefinitions = new PolicySetDefinitionsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -205,6 +219,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "PolicyClient", "2016-04-01"); + return String.format("%s (%s, %s)", super.userAgent(), "PolicyClient", "2018-03-01"); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionInner.java index 49ff3d1c59d..1ded4fb9754 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionInner.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.resources.implementation; import com.microsoft.azure.management.resources.PolicyType; +import com.microsoft.azure.management.resources.PolicyMode; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -25,6 +26,13 @@ public class PolicyDefinitionInner { @JsonProperty(value = "properties.policyType") private PolicyType policyType; + /** + * The policy definition mode. Possible values are NotSpecified, Indexed, + * and All. Possible values include: 'NotSpecified', 'Indexed', 'All'. + */ + @JsonProperty(value = "properties.mode") + private PolicyMode mode; + /** * The display name of the policy definition. */ @@ -43,6 +51,18 @@ public class PolicyDefinitionInner { @JsonProperty(value = "properties.policyRule") private Object policyRule; + /** + * The policy definition metadata. + */ + @JsonProperty(value = "properties.metadata") + private Object metadata; + + /** + * Required if a parameter is used in policy rule. + */ + @JsonProperty(value = "properties.parameters") + private Object parameters; + /** * The ID of the policy definition. */ @@ -50,12 +70,17 @@ public class PolicyDefinitionInner { private String id; /** - * The name of the policy definition. If you do not specify a value for - * name, the value is inferred from the name value in the request URI. + * The name of the policy definition. */ - @JsonProperty(value = "name") + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; + /** + * The type of the resource (Microsoft.Authorization/policyDefinitions). + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + /** * Get the policyType value. * @@ -76,6 +101,26 @@ public PolicyDefinitionInner withPolicyType(PolicyType policyType) { return this; } + /** + * Get the mode value. + * + * @return the mode value + */ + public PolicyMode mode() { + return this.mode; + } + + /** + * Set the mode value. + * + * @param mode the mode value to set + * @return the PolicyDefinitionInner object itself. + */ + public PolicyDefinitionInner withMode(PolicyMode mode) { + this.mode = mode; + return this; + } + /** * Get the displayName value. * @@ -136,6 +181,46 @@ public PolicyDefinitionInner withPolicyRule(Object policyRule) { return this; } + /** + * Get the metadata value. + * + * @return the metadata value + */ + public Object metadata() { + return this.metadata; + } + + /** + * Set the metadata value. + * + * @param metadata the metadata value to set + * @return the PolicyDefinitionInner object itself. + */ + public PolicyDefinitionInner withMetadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the parameters value. + * + * @return the parameters value + */ + public Object parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @param parameters the parameters value to set + * @return the PolicyDefinitionInner object itself. + */ + public PolicyDefinitionInner withParameters(Object parameters) { + this.parameters = parameters; + return this; + } + /** * Get the id value. * @@ -155,14 +240,12 @@ public String name() { } /** - * Set the name value. + * Get the type value. * - * @param name the name value to set - * @return the PolicyDefinitionInner object itself. + * @return the type value */ - public PolicyDefinitionInner withName(String name) { - this.name = name; - return this; + public String type() { + return this.type; } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionsInner.java index ccf58475aea..e852c3628d2 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicyDefinitionsInner.java @@ -62,29 +62,62 @@ public PolicyDefinitionsInner(Retrofit retrofit, PolicyClientImpl client) { */ interface PolicyDefinitionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyDefinitions createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}") + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") Observable> createOrUpdate(@Path("policyDefinitionName") String policyDefinitionName, @Path("subscriptionId") String subscriptionId, @Body PolicyDefinitionInner parameters, @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.PolicyDefinitions delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", method = "DELETE", hasBody = true) Observable> delete(@Path("policyDefinitionName") String policyDefinitionName, @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.PolicyDefinitions get" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}") + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") Observable> get(@Path("policyDefinitionName") String policyDefinitionName, @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.PolicyDefinitions getBuiltIn" }) + @GET("providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") + Observable> getBuiltIn(@Path("policyDefinitionName") String policyDefinitionName, @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.PolicyDefinitions createOrUpdateAtManagementGroup" }) + @PUT("providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") + Observable> createOrUpdateAtManagementGroup(@Path("policyDefinitionName") String policyDefinitionName, @Path("managementGroupId") String managementGroupId, @Body PolicyDefinitionInner parameters, @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.PolicyDefinitions deleteAtManagementGroup" }) + @HTTP(path = "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", method = "DELETE", hasBody = true) + Observable> deleteAtManagementGroup(@Path("policyDefinitionName") String policyDefinitionName, @Path("managementGroupId") String managementGroupId, @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.PolicyDefinitions getAtManagementGroup" }) + @GET("providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") + Observable> getAtManagementGroup(@Path("policyDefinitionName") String policyDefinitionName, @Path("managementGroupId") String managementGroupId, @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.PolicyDefinitions list" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions") - Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions") + 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.PolicyDefinitions listBuiltIn" }) + @GET("providers/Microsoft.Authorization/policyDefinitions") + Observable> listBuiltIn(@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.PolicyDefinitions listByManagementGroup" }) + @GET("providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions") + Observable> listByManagementGroup(@Path("managementGroupId") String managementGroupId, @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.PolicyDefinitions listNext" }) @GET Observable> listNext(@Url String nextUrl, @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.PolicyDefinitions listBuiltInNext" }) + @GET + Observable> listBuiltInNext(@Url String nextUrl, @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.PolicyDefinitions listByManagementGroupNext" }) + @GET + Observable> listByManagementGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** - * Creates or updates a policy definition. + * Creates or updates a policy definition in a subscription. + * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. @@ -98,7 +131,8 @@ public PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyD } /** - * Creates or updates a policy definition. + * Creates or updates a policy definition in a subscription. + * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. @@ -111,7 +145,8 @@ public ServiceFuture createOrUpdateAsync(String policyDef } /** - * Creates or updates a policy definition. + * Creates or updates a policy definition in a subscription. + * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. @@ -128,7 +163,8 @@ public PolicyDefinitionInner call(ServiceResponse respons } /** - * Creates or updates a policy definition. + * Creates or updates a policy definition in a subscription. + * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. @@ -171,7 +207,8 @@ private ServiceResponse createOrUpdateDelegate(Response deleteAsync(String policyDefinitionName, final Servic } /** - * Deletes a policy definition. + * Deletes a policy definition in a subscription. + * This operation deletes the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to delete. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -211,7 +250,8 @@ public Void call(ServiceResponse response) { } /** - * Deletes a policy definition. + * Deletes a policy definition in a subscription. + * This operation deletes the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to delete. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -250,7 +290,8 @@ private ServiceResponse deleteDelegate(Response response) th } /** - * Gets the policy definition. + * Retrieves a policy definition in a subscription. + * This operation retrieves the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -263,7 +304,8 @@ public PolicyDefinitionInner get(String policyDefinitionName) { } /** - * Gets the policy definition. + * Retrieves a policy definition in a subscription. + * This operation retrieves the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -275,7 +317,8 @@ public ServiceFuture getAsync(String policyDefinitionName } /** - * Gets the policy definition. + * Retrieves a policy definition in a subscription. + * This operation retrieves the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -291,7 +334,8 @@ public PolicyDefinitionInner call(ServiceResponse respons } /** - * Gets the policy definition. + * Retrieves a policy definition in a subscription. + * This operation retrieves the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -329,99 +373,166 @@ private ServiceResponse getDelegate(Response list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public PolicyDefinitionInner getBuiltIn(String policyDefinitionName) { + return getBuiltInWithServiceResponseAsync(policyDefinitionName).toBlocking().single().body(); } /** - * Gets all the policy definitions for a subscription. + * Retrieves a built-in policy definition. + * This operation retrieves the built-in policy definition with the given name. * + * @param policyDefinitionName The name of the built-in policy definition to get. * @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); + public ServiceFuture getBuiltInAsync(String policyDefinitionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBuiltInWithServiceResponseAsync(policyDefinitionName), serviceCallback); } /** - * Gets all the policy definitions for a subscription. + * Retrieves a built-in policy definition. + * This operation retrieves the built-in policy definition with the given name. * + * @param policyDefinitionName The name of the built-in policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<PolicyDefinitionInner> object + * @return the observable to the PolicyDefinitionInner object */ - public Observable> listAsync() { - return listWithServiceResponseAsync() - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable getBuiltInAsync(String policyDefinitionName) { + return getBuiltInWithServiceResponseAsync(policyDefinitionName).map(new Func1, PolicyDefinitionInner>() { + @Override + public PolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets all the policy definitions for a subscription. + * Retrieves a built-in policy definition. + * This operation retrieves the built-in policy definition with the given name. * + * @param policyDefinitionName The name of the built-in policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<PolicyDefinitionInner> object + * @return the observable to the PolicyDefinitionInner object */ - public Observable>> listWithServiceResponseAsync() { - return listSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { + public Observable> getBuiltInWithServiceResponseAsync(String policyDefinitionName) { + if (policyDefinitionName == null) { + throw new IllegalArgumentException("Parameter policyDefinitionName 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.getBuiltIn(policyDefinitionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBuiltInDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } + private ServiceResponse getBuiltInDelegate(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); + } + /** - * Gets all the policy definitions for a subscription. + * Creates or updates a policy definition in a management group. + * This operation creates or updates a policy definition in the given management group with the given name. * + * @param policyDefinitionName The name of the policy definition to create. + * @param managementGroupId The ID of the management group. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @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 PolicyDefinitionInner object if successful. */ - public Observable>> listSinglePageAsync() { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + public PolicyDefinitionInner createOrUpdateAtManagementGroup(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) { + return createOrUpdateAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a policy definition in a management group. + * This operation creates or updates a policy definition in the given management group with the given name. + * + * @param policyDefinitionName The name of the policy definition to create. + * @param managementGroupId The ID of the management group. + * @param parameters The policy definition properties. + * @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 createOrUpdateAtManagementGroupAsync(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId, parameters), serviceCallback); + } + + /** + * Creates or updates a policy definition in a management group. + * This operation creates or updates a policy definition in the given management group with the given name. + * + * @param policyDefinitionName The name of the policy definition to create. + * @param managementGroupId The ID of the management group. + * @param parameters The policy definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PolicyDefinitionInner object + */ + public Observable createOrUpdateAtManagementGroupAsync(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) { + return createOrUpdateAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId, parameters).map(new Func1, PolicyDefinitionInner>() { + @Override + public PolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a policy definition in a management group. + * This operation creates or updates a policy definition in the given management group with the given name. + * + * @param policyDefinitionName The name of the policy definition to create. + * @param managementGroupId The ID of the management group. + * @param parameters The policy definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PolicyDefinitionInner object + */ + public Observable> createOrUpdateAtManagementGroupWithServiceResponseAsync(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) { + if (policyDefinitionName == null) { + throw new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null."); + } + if (managementGroupId == null) { + throw new IllegalArgumentException("Parameter managementGroupId is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - final String filter = null; - return service.list(this.client.subscriptionId(), filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + Validator.validate(parameters); + return service.createOrUpdateAtManagementGroup(policyDefinitionName, managementGroupId, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .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 clientResponse = createOrUpdateAtManagementGroupDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -429,104 +540,173 @@ public Observable>> call(Response createOrUpdateAtManagementGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * Gets all the policy definitions for a subscription. + * Deletes a policy definition in a management group. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. + * @param policyDefinitionName The name of the policy definition to delete. + * @param managementGroupId The ID of the management group. * @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<PolicyDefinitionInner> object if successful. */ - public PagedList list(final String filter) { - ServiceResponse> response = listSinglePageAsync(filter).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public void deleteAtManagementGroup(String policyDefinitionName, String managementGroupId) { + deleteAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).toBlocking().single().body(); } /** - * Gets all the policy definitions for a subscription. + * Deletes a policy definition in a management group. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. + * @param policyDefinitionName The name of the policy definition to delete. + * @param managementGroupId The ID of the management group. * @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 ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(filter), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture deleteAtManagementGroupAsync(String policyDefinitionName, String managementGroupId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId), serviceCallback); } /** - * Gets all the policy definitions for a subscription. + * Deletes a policy definition in a management group. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. + * @param policyDefinitionName The name of the policy definition to delete. + * @param managementGroupId The ID of the management group. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<PolicyDefinitionInner> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listAsync(final String filter) { - return listWithServiceResponseAsync(filter) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable deleteAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) { + return deleteAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets all the policy definitions for a subscription. + * Deletes a policy definition in a management group. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. + * @param policyDefinitionName The name of the policy definition to delete. + * @param managementGroupId The ID of the management group. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<PolicyDefinitionInner> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable>> listWithServiceResponseAsync(final String filter) { - return listSinglePageAsync(filter) - .concatMap(new Func1>, Observable>>>() { + public Observable> deleteAtManagementGroupWithServiceResponseAsync(String policyDefinitionName, String managementGroupId) { + if (policyDefinitionName == null) { + throw new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null."); + } + if (managementGroupId == null) { + throw new IllegalArgumentException("Parameter managementGroupId 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.deleteAtManagementGroup(policyDefinitionName, managementGroupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAtManagementGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } + private ServiceResponse deleteAtManagementGroupDelegate(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 all the policy definitions for a subscription. + * Retrieve a policy definition in a management group. + * This operation retrieves the policy definition in the given management group with the given name. * - ServiceResponse> * @param filter The filter to apply on the operation. + * @param policyDefinitionName The name of the policy definition to get. + * @param managementGroupId The ID of the management group. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @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 PolicyDefinitionInner object if successful. */ - public Observable>> listSinglePageAsync(final String filter) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + public PolicyDefinitionInner getAtManagementGroup(String policyDefinitionName, String managementGroupId) { + return getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).toBlocking().single().body(); + } + + /** + * Retrieve a policy definition in a management group. + * This operation retrieves the policy definition in the given management group with the given name. + * + * @param policyDefinitionName The name of the policy definition to get. + * @param managementGroupId The ID of the management group. + * @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 getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId), serviceCallback); + } + + /** + * Retrieve a policy definition in a management group. + * This operation retrieves the policy definition in the given management group with the given name. + * + * @param policyDefinitionName The name of the policy definition to get. + * @param managementGroupId The ID of the management group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PolicyDefinitionInner object + */ + public Observable getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) { + return getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).map(new Func1, PolicyDefinitionInner>() { + @Override + public PolicyDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve a policy definition in a management group. + * This operation retrieves the policy definition in the given management group with the given name. + * + * @param policyDefinitionName The name of the policy definition to get. + * @param managementGroupId The ID of the management group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PolicyDefinitionInner object + */ + public Observable> getAtManagementGroupWithServiceResponseAsync(String policyDefinitionName, String managementGroupId) { + if (policyDefinitionName == null) { + throw new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null."); + } + if (managementGroupId == null) { + throw new IllegalArgumentException("Parameter managementGroupId 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(), filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.getAtManagementGroup(policyDefinitionName, managementGroupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .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 clientResponse = getAtManagementGroupDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -534,24 +714,24 @@ 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 getAtManagementGroupDelegate(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); } /** - * Gets all the policy definitions for a subscription. + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given 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<PolicyDefinitionInner> object if successful. */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { @@ -561,15 +741,350 @@ public Page nextPage(String nextPageLink) { } /** - * Gets all the policy definitions for a subscription. + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given 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) { + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PolicyDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PolicyDefinitionInner> 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)); + } + }); + } + + /** + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PolicyDefinitionInner> 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); + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @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<PolicyDefinitionInner> object if successful. + */ + public PagedList listBuiltIn() { + ServiceResponse> response = listBuiltInSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBuiltInNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @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> listBuiltInAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBuiltInSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBuiltInNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PolicyDefinitionInner> object + */ + public Observable> listBuiltInAsync() { + return listBuiltInWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PolicyDefinitionInner> object + */ + public Observable>> listBuiltInWithServiceResponseAsync() { + return listBuiltInSinglePageAsync() + .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(listBuiltInNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBuiltInSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listBuiltIn(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBuiltInDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBuiltInDelegate(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 all the policy definitions in a management group. + * + * @param managementGroupId The ID of the management group. + * @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<PolicyDefinitionInner> object if successful. + */ + public PagedList listByManagementGroup(final String managementGroupId) { + ServiceResponse> response = listByManagementGroupSinglePageAsync(managementGroupId).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByManagementGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the policy definitions in a management group. + * + * @param managementGroupId The ID of the management group. + * @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> listByManagementGroupAsync(final String managementGroupId, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByManagementGroupSinglePageAsync(managementGroupId), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByManagementGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the policy definitions in a management group. + * + * @param managementGroupId The ID of the management group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PolicyDefinitionInner> object + */ + public Observable> listByManagementGroupAsync(final String managementGroupId) { + return listByManagementGroupWithServiceResponseAsync(managementGroupId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the policy definitions in a management group. + * + * @param managementGroupId The ID of the management group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PolicyDefinitionInner> object + */ + public Observable>> listByManagementGroupWithServiceResponseAsync(final String managementGroupId) { + return listByManagementGroupSinglePageAsync(managementGroupId) + .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(listByManagementGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the policy definitions in a management group. + * + ServiceResponse> * @param managementGroupId The ID of the management group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByManagementGroupSinglePageAsync(final String managementGroupId) { + if (managementGroupId == null) { + throw new IllegalArgumentException("Parameter managementGroupId 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.listByManagementGroup(managementGroupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByManagementGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByManagementGroupDelegate(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); + } + + /** + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given 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<PolicyDefinitionInner> 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(); + } + }; + } + + /** + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given 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>>>() { @@ -582,7 +1097,8 @@ public Observable>> call(String next } /** - * Gets all the policy definitions for a subscription. + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -599,7 +1115,8 @@ public Page call(ServiceResponse>> call(ServiceResp } /** - * Gets all the policy definitions for a subscription. + * Retrieves policy definitions in a subscription. + * This operation retrieves a list of all the policy definitions in a given subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -652,4 +1170,231 @@ private ServiceResponse> listNextDelegate(Respon .build(response); } + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @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<PolicyDefinitionInner> object if successful. + */ + public PagedList listBuiltInNext(final String nextPageLink) { + ServiceResponse> response = listBuiltInNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBuiltInNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @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> listBuiltInNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBuiltInNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBuiltInNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @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<PolicyDefinitionInner> object + */ + public Observable> listBuiltInNextAsync(final String nextPageLink) { + return listBuiltInNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + * @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<PolicyDefinitionInner> object + */ + public Observable>> listBuiltInNextWithServiceResponseAsync(final String nextPageLink) { + return listBuiltInNextSinglePageAsync(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(listBuiltInNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBuiltInNextSinglePageAsync(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.listBuiltInNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBuiltInNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBuiltInNextDelegate(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 all the policy definitions in a management group. + * + * @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<PolicyDefinitionInner> object if successful. + */ + public PagedList listByManagementGroupNext(final String nextPageLink) { + ServiceResponse> response = listByManagementGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByManagementGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the policy definitions in a management group. + * + * @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> listByManagementGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByManagementGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByManagementGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the policy definitions in a management group. + * + * @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<PolicyDefinitionInner> object + */ + public Observable> listByManagementGroupNextAsync(final String nextPageLink) { + return listByManagementGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the policy definitions in a management group. + * + * @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<PolicyDefinitionInner> object + */ + public Observable>> listByManagementGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByManagementGroupNextSinglePageAsync(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(listByManagementGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the policy definitions in a management group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByManagementGroupNextSinglePageAsync(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.listByManagementGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByManagementGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByManagementGroupNextDelegate(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/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicySetDefinitionsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicySetDefinitionsInner.java index 072390bab06..0324e151fac 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicySetDefinitionsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/PolicySetDefinitionsInner.java @@ -117,6 +117,7 @@ interface PolicySetDefinitionsService { /** * Creates or updates a policy set definition. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. @@ -131,6 +132,7 @@ public PolicySetDefinitionInner createOrUpdate(String policySetDefinitionName, P /** * Creates or updates a policy set definition. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. @@ -144,6 +146,7 @@ public ServiceFuture createOrUpdateAsync(String policy /** * Creates or updates a policy set definition. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. @@ -161,6 +164,7 @@ public PolicySetDefinitionInner call(ServiceResponse r /** * Creates or updates a policy set definition. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. @@ -177,9 +181,11 @@ public Observable> createOrUpdateWithS if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } Validator.validate(parameters); - final String apiVersion = "2017-06-01-preview"; - return service.createOrUpdate(policySetDefinitionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.createOrUpdate(policySetDefinitionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -203,6 +209,7 @@ private ServiceResponse createOrUpdateDelegate(Respons /** * Deletes a policy set definition. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to delete. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -215,6 +222,7 @@ public void delete(String policySetDefinitionName) { /** * Deletes a policy set definition. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to delete. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -227,6 +235,7 @@ public ServiceFuture deleteAsync(String policySetDefinitionName, final Ser /** * Deletes a policy set definition. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to delete. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -243,6 +252,7 @@ public Void call(ServiceResponse response) { /** * Deletes a policy set definition. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to delete. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -255,8 +265,10 @@ public Observable> deleteWithServiceResponseAsync(String p if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-06-01-preview"; - return service.delete(policySetDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(policySetDefinitionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -279,7 +291,8 @@ private ServiceResponse deleteDelegate(Response response) th } /** - * Gets the policy set definition. + * Retrieves a policy set definition. + * This operation retrieves the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -292,7 +305,8 @@ public PolicySetDefinitionInner get(String policySetDefinitionName) { } /** - * Gets the policy set definition. + * Retrieves a policy set definition. + * This operation retrieves the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -304,7 +318,8 @@ public ServiceFuture getAsync(String policySetDefiniti } /** - * Gets the policy set definition. + * Retrieves a policy set definition. + * This operation retrieves the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -320,7 +335,8 @@ public PolicySetDefinitionInner call(ServiceResponse r } /** - * Gets the policy set definition. + * Retrieves a policy set definition. + * This operation retrieves the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -333,8 +349,10 @@ public Observable> getWithServiceRespo if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-06-01-preview"; - return service.get(policySetDefinitionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(policySetDefinitionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -356,7 +374,8 @@ private ServiceResponse getDelegate(Response getBuiltInAsync(String policySetD } /** - * Gets the built in policy set definition. + * Retrieves a built in policy set definition. + * This operation retrieves the built-in policy set definition with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -397,7 +418,8 @@ public PolicySetDefinitionInner call(ServiceResponse r } /** - * Gets the built in policy set definition. + * Retrieves a built in policy set definition. + * This operation retrieves the built-in policy set definition with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -407,8 +429,10 @@ public Observable> getBuiltInWithServi if (policySetDefinitionName == null) { throw new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null."); } - final String apiVersion = "2017-06-01-preview"; - return service.getBuiltIn(policySetDefinitionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getBuiltIn(policySetDefinitionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -430,7 +454,8 @@ private ServiceResponse getBuiltInDelegate(Response nextPage(String nextPageLink) { } /** - * Gets all the policy set definitions for a subscription. + * Retrieves the policy set definitions for a subscription. + * This operation retrieves a list of all the policy set definitions in the given subscription. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -467,7 +493,8 @@ public Observable>> call(String n } /** - * Gets all the policy set definitions for a subscription. + * Retrieves the policy set definitions for a subscription. + * This operation retrieves a list of all the policy set definitions in the given subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<PolicySetDefinitionInner> object @@ -483,7 +510,8 @@ public Page call(ServiceResponse>> call(ServiceR } /** - * Gets all the policy set definitions for a subscription. + * Retrieves the policy set definitions for a subscription. + * This operation retrieves a list of all the policy set definitions in the given subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicySetDefinitionInner> object wrapped in {@link ServiceResponse} if successful. @@ -512,8 +541,10 @@ public Observable>> listSinglePag if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-06-01-preview"; - return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + 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) { @@ -535,7 +566,8 @@ private ServiceResponse> listDelegate(Respons } /** - * Gets all the built in policy set definitions. + * Retrieves built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions. * * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -553,7 +585,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets all the built in policy set definitions. + * Retrieves built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -572,7 +605,8 @@ public Observable>> call(String n } /** - * Gets all the built in policy set definitions. + * Retrieves built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<PolicySetDefinitionInner> object @@ -588,7 +622,8 @@ public Page call(ServiceResponse>> call(ServiceR } /** - * Gets all the built in policy set definitions. + * Retrieves built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicySetDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listBuiltInSinglePageAsync() { - final String apiVersion = "2017-06-01-preview"; - return service.listBuiltIn(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listBuiltIn(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -629,7 +667,7 @@ public Observable>> call(Response }); } - private ServiceResponse> listBuiltInDelegate(Response response) throws ErrorResponseException, IOException { + private ServiceResponse> listBuiltInDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(ErrorResponseException.class) @@ -637,7 +675,8 @@ private ServiceResponse> listBuiltInDelegate( } /** - * Creates or updates a policy set definition at management group level. + * Creates or updates a policy set definition. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to create. * @param managementGroupId The ID of the management group. @@ -652,7 +691,8 @@ public PolicySetDefinitionInner createOrUpdateAtManagementGroup(String policySet } /** - * Creates or updates a policy set definition at management group level. + * Creates or updates a policy set definition. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to create. * @param managementGroupId The ID of the management group. @@ -666,7 +706,8 @@ public ServiceFuture createOrUpdateAtManagementGroupAs } /** - * Creates or updates a policy set definition at management group level. + * Creates or updates a policy set definition. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to create. * @param managementGroupId The ID of the management group. @@ -684,7 +725,8 @@ public PolicySetDefinitionInner call(ServiceResponse r } /** - * Creates or updates a policy set definition at management group level. + * Creates or updates a policy set definition. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to create. * @param managementGroupId The ID of the management group. @@ -702,9 +744,11 @@ public Observable> createOrUpdateAtMan if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } Validator.validate(parameters); - final String apiVersion = "2017-06-01-preview"; - return service.createOrUpdateAtManagementGroup(policySetDefinitionName, managementGroupId, parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.createOrUpdateAtManagementGroup(policySetDefinitionName, managementGroupId, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -727,7 +771,8 @@ private ServiceResponse createOrUpdateAtManagementGrou } /** - * Deletes a policy set definition at management group level. + * Deletes a policy set definition. + * This operation deletes the policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. @@ -740,7 +785,8 @@ public void deleteAtManagementGroup(String policySetDefinitionName, String manag } /** - * Deletes a policy set definition at management group level. + * Deletes a policy set definition. + * This operation deletes the policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. @@ -753,7 +799,8 @@ public ServiceFuture deleteAtManagementGroupAsync(String policySetDefiniti } /** - * Deletes a policy set definition at management group level. + * Deletes a policy set definition. + * This operation deletes the policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. @@ -770,7 +817,8 @@ public Void call(ServiceResponse response) { } /** - * Deletes a policy set definition at management group level. + * Deletes a policy set definition. + * This operation deletes the policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. @@ -784,8 +832,10 @@ public Observable> deleteAtManagementGroupWithServiceRespo if (managementGroupId == null) { throw new IllegalArgumentException("Parameter managementGroupId is required and cannot be null."); } - final String apiVersion = "2017-06-01-preview"; - return service.deleteAtManagementGroup(policySetDefinitionName, managementGroupId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.deleteAtManagementGroup(policySetDefinitionName, managementGroupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -808,7 +858,8 @@ private ServiceResponse deleteAtManagementGroupDelegate(Response getAtManagementGroupAsync(String } /** - * Gets the policy set definition at management group level. + * Retrieves a policy set definition. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @param managementGroupId The ID of the management group. @@ -852,7 +905,8 @@ public PolicySetDefinitionInner call(ServiceResponse r } /** - * Gets the policy set definition at management group level. + * Retrieves a policy set definition. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @param managementGroupId The ID of the management group. @@ -866,8 +920,10 @@ public Observable> getAtManagementGrou if (managementGroupId == null) { throw new IllegalArgumentException("Parameter managementGroupId is required and cannot be null."); } - final String apiVersion = "2017-06-01-preview"; - return service.getAtManagementGroup(policySetDefinitionName, managementGroupId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getAtManagementGroup(policySetDefinitionName, managementGroupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -889,7 +945,8 @@ private ServiceResponse getAtManagementGroupDelegate(R } /** - * Gets all the policy set definitions for a subscription at management group. + * Retrieves all policy set definitions in management group. + * This operation retrieves a list of all the a policy set definition in the given management group. * * @param managementGroupId The ID of the management group. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -908,7 +965,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets all the policy set definitions for a subscription at management group. + * Retrieves all policy set definitions in management group. + * This operation retrieves a list of all the a policy set definition in the given management group. * * @param managementGroupId The ID of the management group. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -928,7 +986,8 @@ public Observable>> call(String n } /** - * Gets all the policy set definitions for a subscription at management group. + * Retrieves all policy set definitions in management group. + * This operation retrieves a list of all the a policy set definition in the given management group. * * @param managementGroupId The ID of the management group. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -945,7 +1004,8 @@ public Page call(ServiceResponse>> call(ServiceR } /** - * Gets all the policy set definitions for a subscription at management group. + * Retrieves all policy set definitions in management group. + * This operation retrieves a list of all the a policy set definition in the given management group. * ServiceResponse> * @param managementGroupId The ID of the management group. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -976,8 +1037,10 @@ public Observable>> listByManagem if (managementGroupId == null) { throw new IllegalArgumentException("Parameter managementGroupId is required and cannot be null."); } - final String apiVersion = "2017-06-01-preview"; - return service.listByManagementGroup(managementGroupId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByManagementGroup(managementGroupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -999,7 +1062,8 @@ private ServiceResponse> listByManagementGrou } /** - * Gets all the policy set definitions for a subscription. + * Retrieves the policy set definitions for a subscription. + * This operation retrieves a list of all the policy set definitions in the given subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1018,7 +1082,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets all the policy set definitions for a subscription. + * Retrieves the policy set definitions for a subscription. + * This operation retrieves a list of all the policy set definitions in the given subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1039,7 +1104,8 @@ public Observable>> call(String n } /** - * Gets all the policy set definitions for a subscription. + * Retrieves the policy set definitions for a subscription. + * This operation retrieves a list of all the policy set definitions in the given subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1056,7 +1122,8 @@ public Page call(ServiceResponse>> call(ServiceR } /** - * Gets all the policy set definitions for a subscription. + * Retrieves the policy set definitions for a subscription. + * This operation retrieves a list of all the policy set definitions in the given subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1110,7 +1178,8 @@ private ServiceResponse> listNextDelegate(Res } /** - * Gets all the built in policy set definitions. + * Retrieves built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1129,7 +1198,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets all the built in policy set definitions. + * Retrieves built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1150,7 +1220,8 @@ public Observable>> call(String n } /** - * Gets all the built in policy set definitions. + * Retrieves built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1167,7 +1238,8 @@ public Page call(ServiceResponse>> call(ServiceR } /** - * Gets all the built in policy set definitions. + * Retrieves built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1221,7 +1294,8 @@ private ServiceResponse> listBuiltInNextDeleg } /** - * Gets all the policy set definitions for a subscription at management group. + * Retrieves all policy set definitions in management group. + * This operation retrieves a list of all the a policy set definition in the given management group. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1240,7 +1314,8 @@ public Page nextPage(String nextPageLink) { } /** - * Gets all the policy set definitions for a subscription at management group. + * Retrieves all policy set definitions in management group. + * This operation retrieves a list of all the a policy set definition in the given management group. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1261,7 +1336,8 @@ public Observable>> call(String n } /** - * Gets all the policy set definitions for a subscription at management group. + * Retrieves all policy set definitions in management group. + * This operation retrieves a list of all the a policy set definition in the given management group. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1278,7 +1354,8 @@ public Page call(ServiceResponse>> call(ServiceR } /** - * Gets all the policy set definitions for a subscription at management group. + * Retrieves all policy set definitions in management group. + * This operation retrieves a list of all the a policy set definition in the given management group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsInner.java index ff4b8635e66..fda4dd6261b 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsInner.java @@ -13,6 +13,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.resources.ExportTemplateRequest; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -94,7 +95,7 @@ interface ResourceGroupsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.ResourceGroups exportTemplate" }) @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate") - Observable> exportTemplate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ExportTemplateRequestInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> exportTemplate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ExportTemplateRequest parameters, @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.ResourceGroups list" }) @GET("subscriptions/{subscriptionId}/resourcegroups") @@ -847,7 +848,7 @@ private ServiceResponse patchDelegate(Response * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ResourceGroupExportResultInner object if successful. */ - public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequestInner parameters) { + public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequest parameters) { return exportTemplateWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().single().body(); } @@ -860,7 +861,7 @@ public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, E * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture exportTemplateAsync(String resourceGroupName, ExportTemplateRequestInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture exportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(exportTemplateWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback); } @@ -872,7 +873,7 @@ public ServiceFuture exportTemplateAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResourceGroupExportResultInner object */ - public Observable exportTemplateAsync(String resourceGroupName, ExportTemplateRequestInner parameters) { + public Observable exportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters) { return exportTemplateWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1, ResourceGroupExportResultInner>() { @Override public ResourceGroupExportResultInner call(ServiceResponse response) { @@ -889,7 +890,7 @@ public ResourceGroupExportResultInner call(ServiceResponse> exportTemplateWithServiceResponseAsync(String resourceGroupName, ExportTemplateRequestInner parameters) { + public Observable> exportTemplateWithServiceResponseAsync(String resourceGroupName, ExportTemplateRequest parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourcesInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourcesInner.java index 858ee6f91ab..b5cbf0a6e80 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourcesInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourcesInner.java @@ -13,6 +13,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.resources.ResourcesMoveInfo; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -66,11 +67,11 @@ public ResourcesInner(Retrofit retrofit, ResourceManagementClientImpl client) { interface ResourcesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources moveResources" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources") - Observable> moveResources(@Path("sourceResourceGroupName") String sourceResourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourcesMoveInfoInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> moveResources(@Path("sourceResourceGroupName") String sourceResourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourcesMoveInfo parameters, @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.Resources beginMoveResources" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources") - Observable> beginMoveResources(@Path("sourceResourceGroupName") String sourceResourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourcesMoveInfoInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginMoveResources(@Path("sourceResourceGroupName") String sourceResourceGroupName, @Path("subscriptionId") String subscriptionId, @Body ResourcesMoveInfo parameters, @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.Resources list" }) @GET("subscriptions/{subscriptionId}/resources") @@ -156,7 +157,7 @@ interface ResourcesService { * @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 moveResources(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().last().body(); } @@ -170,7 +171,7 @@ public void moveResources(String sourceResourceGroupName, ResourcesMoveInfoInner * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback); } @@ -183,7 +184,7 @@ public ServiceFuture moveResourcesAsync(String sourceResourceGroupName, Re * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + public Observable moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { return moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { @@ -201,7 +202,7 @@ public Void call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> moveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + public Observable> moveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { if (sourceResourceGroupName == null) { throw new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null."); } @@ -229,7 +230,7 @@ public Observable> moveResourcesWithServiceResponseAsync(S * @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 beginMoveResources(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + public void beginMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().single().body(); } @@ -243,7 +244,7 @@ public void beginMoveResources(String sourceResourceGroupName, ResourcesMoveInfo * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback); } @@ -256,7 +257,7 @@ public ServiceFuture beginMoveResourcesAsync(String sourceResourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + public Observable beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { return beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { @@ -274,7 +275,7 @@ public Void call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginMoveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + public Observable> beginMoveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { if (sourceResourceGroupName == null) { throw new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsInner.java index 27d253e39c0..804786a548c 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsInner.java @@ -140,7 +140,11 @@ public Observable>> listLocationsWithService public Observable>> call(Response response) { try { ServiceResponse> result = listLocationsDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t);