diff --git a/sdk/policy/mgmt-v2019_01_01/pom.xml b/sdk/policy/mgmt-v2019_01_01/pom.xml
new file mode 100644
index 0000000000000..0b5e2a32bc259
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/pom.xml
@@ -0,0 +1,135 @@
+
+
+ 4.0.0
+ com.microsoft.azure.policy.v2019_01_01
+
+ com.microsoft.azure
+ azure-arm-parent
+ 1.1.0
+ ../../../pom.management.xml
+
+ azure-mgmt-policy
+ 1.0.0-beta
+ jar
+ Microsoft Azure SDK for Authorization Management
+ This package contains Microsoft Authorization Management SDK.
+ https://github.com/Azure/azure-sdk-for-java
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+ scm:git:https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+ UTF-8
+
+
+
+
+ microsoft
+ Microsoft
+
+
+
+
+ com.microsoft.azure
+ azure-client-runtime
+
+
+ com.microsoft.azure
+ azure-arm-client-runtime
+
+
+ junit
+ junit
+ test
+
+
+ com.microsoft.azure
+ azure-client-authentication
+ test
+
+
+ com.microsoft.azure
+ azure-mgmt-resources
+ test
+
+
+ com.microsoft.azure
+ azure-arm-client-runtime
+ test-jar
+ test
+
+ 1.6.5
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ true
+ true
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+
+ 1.7
+
+
+ com.microsoft.azure.management.apigeneration.LangDefinitionProcessor
+
+
+ true
+ true
+
+ true
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.8
+
+ *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search
+
+
+ /**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+ ]]>
+
+
+
+
+
+
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ErrorResponse.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ErrorResponse.java
new file mode 100644
index 0000000000000..dbef5561f2a5f
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ErrorResponse.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policy.v2019_01_01;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Error response indicates Azure Resource Manager is not able to process the
+ * incoming request. The reason is provided in the error message.
+ */
+public class ErrorResponse {
+ /**
+ * Http status code.
+ */
+ @JsonProperty(value = "httpStatus")
+ private String httpStatus;
+
+ /**
+ * Error code.
+ */
+ @JsonProperty(value = "errorCode")
+ private String errorCode;
+
+ /**
+ * Error message indicating why the operation failed.
+ */
+ @JsonProperty(value = "errorMessage")
+ private String errorMessage;
+
+ /**
+ * Get http status code.
+ *
+ * @return the httpStatus value
+ */
+ public String httpStatus() {
+ return this.httpStatus;
+ }
+
+ /**
+ * Set http status code.
+ *
+ * @param httpStatus the httpStatus value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withHttpStatus(String httpStatus) {
+ this.httpStatus = httpStatus;
+ return this;
+ }
+
+ /**
+ * Get error code.
+ *
+ * @return the errorCode value
+ */
+ public String errorCode() {
+ return this.errorCode;
+ }
+
+ /**
+ * Set error code.
+ *
+ * @param errorCode the errorCode value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withErrorCode(String errorCode) {
+ this.errorCode = errorCode;
+ return this;
+ }
+
+ /**
+ * Get error message indicating why the operation failed.
+ *
+ * @return the errorMessage value
+ */
+ public String errorMessage() {
+ return this.errorMessage;
+ }
+
+ /**
+ * Set error message indicating why the operation failed.
+ *
+ * @param errorMessage the errorMessage value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withErrorMessage(String errorMessage) {
+ this.errorMessage = errorMessage;
+ return this;
+ }
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ErrorResponseException.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ErrorResponseException.java
new file mode 100644
index 0000000000000..84854e9d5ee5c
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ErrorResponseException.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policy.v2019_01_01;
+
+import com.microsoft.rest.RestException;
+import okhttp3.ResponseBody;
+import retrofit2.Response;
+
+/**
+ * Exception thrown for an invalid response with ErrorResponse information.
+ */
+public class ErrorResponseException extends RestException {
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param message the exception message or the response content if a message is not available
+ * @param response the HTTP response
+ */
+ public ErrorResponseException(final String message, final Response response) {
+ super(message, response);
+ }
+
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param message the exception message or the response content if a message is not available
+ * @param response the HTTP response
+ * @param body the deserialized response body
+ */
+ public ErrorResponseException(final String message, final Response response, final ErrorResponse body) {
+ super(message, response, body);
+ }
+
+ @Override
+ public ErrorResponse body() {
+ return (ErrorResponse) super.body();
+ }
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/Identity.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/Identity.java
new file mode 100644
index 0000000000000..c58fbb989b68e
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/Identity.java
@@ -0,0 +1,73 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Identity for the resource.
+ */
+public class Identity {
+ /**
+ * The principal ID of the resource identity.
+ */
+ @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY)
+ private String principalId;
+
+ /**
+ * The tenant ID of the resource identity.
+ */
+ @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY)
+ private String tenantId;
+
+ /**
+ * The identity type. Possible values include: 'SystemAssigned', 'None'.
+ */
+ @JsonProperty(value = "type")
+ private ResourceIdentityType type;
+
+ /**
+ * Get the principal ID of the resource identity.
+ *
+ * @return the principalId value
+ */
+ public String principalId() {
+ return this.principalId;
+ }
+
+ /**
+ * Get the tenant ID of the resource identity.
+ *
+ * @return the tenantId value
+ */
+ public String tenantId() {
+ return this.tenantId;
+ }
+
+ /**
+ * Get the identity type. Possible values include: 'SystemAssigned', 'None'.
+ *
+ * @return the type value
+ */
+ public ResourceIdentityType type() {
+ return this.type;
+ }
+
+ /**
+ * Set the identity type. Possible values include: 'SystemAssigned', 'None'.
+ *
+ * @param type the type value to set
+ * @return the Identity object itself.
+ */
+ public Identity withType(ResourceIdentityType type) {
+ this.type = type;
+ return this;
+ }
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyAssignment.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyAssignment.java
new file mode 100644
index 0000000000000..feb08bb735794
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyAssignment.java
@@ -0,0 +1,378 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyAssignmentInner;
+import com.microsoft.azure.arm.model.Indexable;
+import com.microsoft.azure.arm.model.Creatable;
+import com.microsoft.azure.arm.model.Updatable;
+import com.microsoft.azure.arm.model.Appliable;
+import com.microsoft.azure.arm.model.Refreshable;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyManager;
+import java.util.List;
+
+/**
+ * Type representing PolicyAssignment.
+ */
+public interface PolicyAssignment extends HasInner, Indexable, Updatable, Refreshable, HasManager {
+ /**
+ * @return the description value.
+ */
+ String description();
+
+ /**
+ * @return the displayName value.
+ */
+ String displayName();
+
+ /**
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * @return the identity value.
+ */
+ Identity identity();
+
+ /**
+ * @return the location value.
+ */
+ String location();
+
+ /**
+ * @return the metadata value.
+ */
+ Object metadata();
+
+ /**
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * @return the notScopes value.
+ */
+ List notScopes();
+
+ /**
+ * @return the parameters value.
+ */
+ Object parameters();
+
+ /**
+ * @return the policyDefinitionId value.
+ */
+ String policyDefinitionId();
+
+ /**
+ * @return the scopeProperty value.
+ */
+ String scopeProperty();
+
+ /**
+ * @return the sku value.
+ */
+ PolicySku sku();
+
+ /**
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * The entirety of the PolicyAssignment definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * Grouping of PolicyAssignment definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of a PolicyAssignment definition.
+ */
+ interface Blank extends WithScope {
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify Scope.
+ */
+ interface WithScope {
+ /**
+ * Specifies scope.
+ * @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}'
+ * @return the next definition stage
+ */
+ WithCreate withScope(String scope);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify Description.
+ */
+ interface WithDescription {
+ /**
+ * Specifies description.
+ * @param description This message will be part of response in case of policy violation
+ * @return the next definition stage
+ */
+ WithCreate withDescription(String description);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify DisplayName.
+ */
+ interface WithDisplayName {
+ /**
+ * Specifies displayName.
+ * @param displayName The display name of the policy assignment
+ * @return the next definition stage
+ */
+ WithCreate withDisplayName(String displayName);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify Identity.
+ */
+ interface WithIdentity {
+ /**
+ * Specifies identity.
+ * @param identity The managed identity associated with the policy assignment
+ * @return the next definition stage
+ */
+ WithCreate withIdentity(Identity identity);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify Location.
+ */
+ interface WithLocation {
+ /**
+ * Specifies location.
+ * @param location The location of the policy assignment. Only required when utilizing managed identity
+ * @return the next definition stage
+ */
+ WithCreate withLocation(String location);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify Metadata.
+ */
+ interface WithMetadata {
+ /**
+ * Specifies metadata.
+ * @param metadata The policy assignment metadata
+ * @return the next definition stage
+ */
+ WithCreate withMetadata(Object metadata);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify NotScopes.
+ */
+ interface WithNotScopes {
+ /**
+ * Specifies notScopes.
+ * @param notScopes The policy's excluded scopes
+ * @return the next definition stage
+ */
+ WithCreate withNotScopes(List notScopes);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify Parameters.
+ */
+ interface WithParameters {
+ /**
+ * Specifies parameters.
+ * @param parameters Required if a parameter is used in policy rule
+ * @return the next definition stage
+ */
+ WithCreate withParameters(Object parameters);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify PolicyDefinitionId.
+ */
+ interface WithPolicyDefinitionId {
+ /**
+ * Specifies policyDefinitionId.
+ * @param policyDefinitionId The ID of the policy definition or policy set definition being assigned
+ * @return the next definition stage
+ */
+ WithCreate withPolicyDefinitionId(String policyDefinitionId);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify ScopeProperty.
+ */
+ interface WithScopeProperty {
+ /**
+ * Specifies scopeProperty.
+ * @param scopeProperty The scope for the policy assignment
+ * @return the next definition stage
+ */
+ WithCreate withScopeProperty(String scopeProperty);
+ }
+
+ /**
+ * The stage of the policyassignment definition allowing to specify Sku.
+ */
+ interface WithSku {
+ /**
+ * Specifies sku.
+ * @param sku The policy sku. This property is optional, obsolete, and will be ignored
+ * @return the next definition stage
+ */
+ WithCreate withSku(PolicySku sku);
+ }
+
+ /**
+ * The stage of the definition which contains all the minimum required inputs for
+ * the resource to be created (via {@link WithCreate#create()}), but also allows
+ * for any other optional settings to be specified.
+ */
+ interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithDisplayName, DefinitionStages.WithIdentity, DefinitionStages.WithLocation, DefinitionStages.WithMetadata, DefinitionStages.WithNotScopes, DefinitionStages.WithParameters, DefinitionStages.WithPolicyDefinitionId, DefinitionStages.WithScopeProperty, DefinitionStages.WithSku {
+ }
+ }
+ /**
+ * The template for a PolicyAssignment update operation, containing all the settings that can be modified.
+ */
+ interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithDisplayName, UpdateStages.WithIdentity, UpdateStages.WithLocation, UpdateStages.WithMetadata, UpdateStages.WithNotScopes, UpdateStages.WithParameters, UpdateStages.WithPolicyDefinitionId, UpdateStages.WithScopeProperty, UpdateStages.WithSku {
+ }
+
+ /**
+ * Grouping of PolicyAssignment update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the policyassignment update allowing to specify Description.
+ */
+ interface WithDescription {
+ /**
+ * Specifies description.
+ * @param description This message will be part of response in case of policy violation
+ * @return the next update stage
+ */
+ Update withDescription(String description);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify DisplayName.
+ */
+ interface WithDisplayName {
+ /**
+ * Specifies displayName.
+ * @param displayName The display name of the policy assignment
+ * @return the next update stage
+ */
+ Update withDisplayName(String displayName);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify Identity.
+ */
+ interface WithIdentity {
+ /**
+ * Specifies identity.
+ * @param identity The managed identity associated with the policy assignment
+ * @return the next update stage
+ */
+ Update withIdentity(Identity identity);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify Location.
+ */
+ interface WithLocation {
+ /**
+ * Specifies location.
+ * @param location The location of the policy assignment. Only required when utilizing managed identity
+ * @return the next update stage
+ */
+ Update withLocation(String location);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify Metadata.
+ */
+ interface WithMetadata {
+ /**
+ * Specifies metadata.
+ * @param metadata The policy assignment metadata
+ * @return the next update stage
+ */
+ Update withMetadata(Object metadata);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify NotScopes.
+ */
+ interface WithNotScopes {
+ /**
+ * Specifies notScopes.
+ * @param notScopes The policy's excluded scopes
+ * @return the next update stage
+ */
+ Update withNotScopes(List notScopes);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify Parameters.
+ */
+ interface WithParameters {
+ /**
+ * Specifies parameters.
+ * @param parameters Required if a parameter is used in policy rule
+ * @return the next update stage
+ */
+ Update withParameters(Object parameters);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify PolicyDefinitionId.
+ */
+ interface WithPolicyDefinitionId {
+ /**
+ * Specifies policyDefinitionId.
+ * @param policyDefinitionId The ID of the policy definition or policy set definition being assigned
+ * @return the next update stage
+ */
+ Update withPolicyDefinitionId(String policyDefinitionId);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify ScopeProperty.
+ */
+ interface WithScopeProperty {
+ /**
+ * Specifies scopeProperty.
+ * @param scopeProperty The scope for the policy assignment
+ * @return the next update stage
+ */
+ Update withScopeProperty(String scopeProperty);
+ }
+
+ /**
+ * The stage of the policyassignment update allowing to specify Sku.
+ */
+ interface WithSku {
+ /**
+ * Specifies sku.
+ * @param sku The policy sku. This property is optional, obsolete, and will be ignored
+ * @return the next update stage
+ */
+ Update withSku(PolicySku sku);
+ }
+
+ }
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyAssignments.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyAssignments.java
new file mode 100644
index 0000000000000..be4e0c886a4f5
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyAssignments.java
@@ -0,0 +1,91 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.microsoft.azure.arm.collection.SupportsCreating;
+import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup;
+import com.microsoft.azure.arm.collection.SupportsListing;
+import rx.Completable;
+import rx.Observable;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyAssignmentInner;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyAssignmentsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing PolicyAssignments.
+ */
+public interface PolicyAssignments extends SupportsCreating, SupportsListingByResourceGroup, SupportsListing, HasInner {
+ /**
+ * 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. 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 for the request
+ */
+ Observable deleteAsync(String scope, String policyAssignmentName);
+
+ /**
+ * 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. 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 for the request
+ */
+ Observable getAsync(String scope, String policyAssignmentName);
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource. 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.
+ * @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 for the request
+ */
+ Observable listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName);
+
+ /**
+ * 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/{policyAssignmentName}'.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable deleteByIdAsync(String policyAssignmentId);
+
+ /**
+ * 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/{policyAssignmentName}'.
+ * @param parameters Parameters for policy assignment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters);
+
+ /**
+ * 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/{policyAssignmentName}'.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable getByIdAsync(String policyAssignmentId);
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinition.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinition.java
new file mode 100644
index 0000000000000..71304de54eac3
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinition.java
@@ -0,0 +1,278 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyDefinitionInner;
+import com.microsoft.azure.arm.model.Indexable;
+import com.microsoft.azure.arm.model.Creatable;
+import com.microsoft.azure.arm.model.Updatable;
+import com.microsoft.azure.arm.model.Appliable;
+import com.microsoft.azure.arm.model.Refreshable;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyManager;
+
+/**
+ * Type representing PolicyDefinition.
+ */
+public interface PolicyDefinition extends HasInner, Indexable, Updatable, Refreshable, HasManager {
+ /**
+ * @return the description value.
+ */
+ String description();
+
+ /**
+ * @return the displayName value.
+ */
+ String displayName();
+
+ /**
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * @return the metadata value.
+ */
+ Object metadata();
+
+ /**
+ * @return the mode value.
+ */
+ String mode();
+
+ /**
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * @return the parameters value.
+ */
+ Object parameters();
+
+ /**
+ * @return the policyRule value.
+ */
+ Object policyRule();
+
+ /**
+ * @return the policyType value.
+ */
+ PolicyType policyType();
+
+ /**
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * The entirety of the PolicyDefinition definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * Grouping of PolicyDefinition definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of a PolicyDefinition definition.
+ */
+ interface Blank extends WithCreate {
+ }
+
+ /**
+ * The stage of the policydefinition definition allowing to specify Description.
+ */
+ interface WithDescription {
+ /**
+ * Specifies description.
+ * @param description The policy definition description
+ * @return the next definition stage
+ */
+ WithCreate withDescription(String description);
+ }
+
+ /**
+ * The stage of the policydefinition definition allowing to specify DisplayName.
+ */
+ interface WithDisplayName {
+ /**
+ * Specifies displayName.
+ * @param displayName The display name of the policy definition
+ * @return the next definition stage
+ */
+ WithCreate withDisplayName(String displayName);
+ }
+
+ /**
+ * The stage of the policydefinition definition allowing to specify Metadata.
+ */
+ interface WithMetadata {
+ /**
+ * Specifies metadata.
+ * @param metadata The policy definition metadata
+ * @return the next definition stage
+ */
+ WithCreate withMetadata(Object metadata);
+ }
+
+ /**
+ * The stage of the policydefinition definition allowing to specify Mode.
+ */
+ interface WithMode {
+ /**
+ * Specifies mode.
+ * @param mode The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data
+ * @return the next definition stage
+ */
+ WithCreate withMode(String mode);
+ }
+
+ /**
+ * The stage of the policydefinition definition allowing to specify Parameters.
+ */
+ interface WithParameters {
+ /**
+ * Specifies parameters.
+ * @param parameters Required if a parameter is used in policy rule
+ * @return the next definition stage
+ */
+ WithCreate withParameters(Object parameters);
+ }
+
+ /**
+ * The stage of the policydefinition definition allowing to specify PolicyRule.
+ */
+ interface WithPolicyRule {
+ /**
+ * Specifies policyRule.
+ * @param policyRule The policy rule
+ * @return the next definition stage
+ */
+ WithCreate withPolicyRule(Object policyRule);
+ }
+
+ /**
+ * The stage of the policydefinition definition allowing to specify PolicyType.
+ */
+ interface WithPolicyType {
+ /**
+ * Specifies policyType.
+ * @param policyType The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom'
+ * @return the next definition stage
+ */
+ WithCreate withPolicyType(PolicyType policyType);
+ }
+
+ /**
+ * The stage of the definition which contains all the minimum required inputs for
+ * the resource to be created (via {@link WithCreate#create()}), but also allows
+ * for any other optional settings to be specified.
+ */
+ interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithDisplayName, DefinitionStages.WithMetadata, DefinitionStages.WithMode, DefinitionStages.WithParameters, DefinitionStages.WithPolicyRule, DefinitionStages.WithPolicyType {
+ }
+ }
+ /**
+ * The template for a PolicyDefinition update operation, containing all the settings that can be modified.
+ */
+ interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithDisplayName, UpdateStages.WithMetadata, UpdateStages.WithMode, UpdateStages.WithParameters, UpdateStages.WithPolicyRule, UpdateStages.WithPolicyType {
+ }
+
+ /**
+ * Grouping of PolicyDefinition update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the policydefinition update allowing to specify Description.
+ */
+ interface WithDescription {
+ /**
+ * Specifies description.
+ * @param description The policy definition description
+ * @return the next update stage
+ */
+ Update withDescription(String description);
+ }
+
+ /**
+ * The stage of the policydefinition update allowing to specify DisplayName.
+ */
+ interface WithDisplayName {
+ /**
+ * Specifies displayName.
+ * @param displayName The display name of the policy definition
+ * @return the next update stage
+ */
+ Update withDisplayName(String displayName);
+ }
+
+ /**
+ * The stage of the policydefinition update allowing to specify Metadata.
+ */
+ interface WithMetadata {
+ /**
+ * Specifies metadata.
+ * @param metadata The policy definition metadata
+ * @return the next update stage
+ */
+ Update withMetadata(Object metadata);
+ }
+
+ /**
+ * The stage of the policydefinition update allowing to specify Mode.
+ */
+ interface WithMode {
+ /**
+ * Specifies mode.
+ * @param mode The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data
+ * @return the next update stage
+ */
+ Update withMode(String mode);
+ }
+
+ /**
+ * The stage of the policydefinition update allowing to specify Parameters.
+ */
+ interface WithParameters {
+ /**
+ * Specifies parameters.
+ * @param parameters Required if a parameter is used in policy rule
+ * @return the next update stage
+ */
+ Update withParameters(Object parameters);
+ }
+
+ /**
+ * The stage of the policydefinition update allowing to specify PolicyRule.
+ */
+ interface WithPolicyRule {
+ /**
+ * Specifies policyRule.
+ * @param policyRule The policy rule
+ * @return the next update stage
+ */
+ Update withPolicyRule(Object policyRule);
+ }
+
+ /**
+ * The stage of the policydefinition update allowing to specify PolicyType.
+ */
+ interface WithPolicyType {
+ /**
+ * Specifies policyType.
+ * @param policyType The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom'
+ * @return the next update stage
+ */
+ Update withPolicyType(PolicyType policyType);
+ }
+
+ }
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinitionReference.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinitionReference.java
new file mode 100644
index 0000000000000..e3d8274b6860d
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinitionReference.java
@@ -0,0 +1,69 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The policy definition reference.
+ */
+public class PolicyDefinitionReference {
+ /**
+ * The ID of the policy definition or policy set definition.
+ */
+ @JsonProperty(value = "policyDefinitionId")
+ private String policyDefinitionId;
+
+ /**
+ * Required if a parameter is used in policy rule.
+ */
+ @JsonProperty(value = "parameters")
+ private Object parameters;
+
+ /**
+ * Get the ID of the policy definition or policy set definition.
+ *
+ * @return the policyDefinitionId value
+ */
+ public String policyDefinitionId() {
+ return this.policyDefinitionId;
+ }
+
+ /**
+ * Set the ID of the policy definition or policy set definition.
+ *
+ * @param policyDefinitionId the policyDefinitionId value to set
+ * @return the PolicyDefinitionReference object itself.
+ */
+ public PolicyDefinitionReference withPolicyDefinitionId(String policyDefinitionId) {
+ this.policyDefinitionId = policyDefinitionId;
+ return this;
+ }
+
+ /**
+ * Get required if a parameter is used in policy rule.
+ *
+ * @return the parameters value
+ */
+ public Object parameters() {
+ return this.parameters;
+ }
+
+ /**
+ * Set required if a parameter is used in policy rule.
+ *
+ * @param parameters the parameters value to set
+ * @return the PolicyDefinitionReference object itself.
+ */
+ public PolicyDefinitionReference withParameters(Object parameters) {
+ this.parameters = parameters;
+ return this;
+ }
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinitions.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinitions.java
new file mode 100644
index 0000000000000..c81a8ba692d1b
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyDefinitions.java
@@ -0,0 +1,106 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.microsoft.azure.arm.collection.SupportsCreating;
+import com.microsoft.azure.arm.collection.SupportsListing;
+import rx.Completable;
+import rx.Observable;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyDefinitionInner;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyDefinitionsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing PolicyDefinitions.
+ */
+public interface PolicyDefinitions extends SupportsCreating, SupportsListing, HasInner {
+ /**
+ * 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
+ * @return the observable for the request
+ */
+ Completable deleteAsync(String policyDefinitionName);
+
+ /**
+ * 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
+ * @return the observable for the request
+ */
+ Observable getAsync(String policyDefinitionName);
+
+ /**
+ * 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 for the request
+ */
+ Observable getBuiltInAsync(String policyDefinitionName);
+
+ /**
+ * 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 for the request
+ */
+ Observable createOrUpdateAtManagementGroupAsync(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters);
+
+ /**
+ * Deletes a policy definition in a management group.
+ * This operation deletes the policy definition in the given management group with the given name.
+ *
+ * @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 for the request
+ */
+ Completable deleteAtManagementGroupAsync(String policyDefinitionName, String managementGroupId);
+
+ /**
+ * 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 for the request
+ */
+ Observable getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId);
+
+ /**
+ * Retrieve policy definitions in a management group.
+ * This operation retrieves a list of all the policy definitions in a given management group.
+ *
+ * @param managementGroupId The ID of the management group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listByManagementGroupAsync(final String managementGroupId);
+
+ /**
+ * 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 for the request
+ */
+ Observable listBuiltInAsync();
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySetDefinition.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySetDefinition.java
new file mode 100644
index 0000000000000..6c91e234cca8d
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySetDefinition.java
@@ -0,0 +1,238 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicySetDefinitionInner;
+import com.microsoft.azure.arm.model.Indexable;
+import com.microsoft.azure.arm.model.Creatable;
+import com.microsoft.azure.arm.model.Updatable;
+import com.microsoft.azure.arm.model.Appliable;
+import com.microsoft.azure.arm.model.Refreshable;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicyManager;
+import java.util.List;
+
+/**
+ * Type representing PolicySetDefinition.
+ */
+public interface PolicySetDefinition extends HasInner, Indexable, Updatable, Refreshable, HasManager {
+ /**
+ * @return the description value.
+ */
+ String description();
+
+ /**
+ * @return the displayName value.
+ */
+ String displayName();
+
+ /**
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * @return the metadata value.
+ */
+ Object metadata();
+
+ /**
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * @return the parameters value.
+ */
+ Object parameters();
+
+ /**
+ * @return the policyDefinitions value.
+ */
+ List policyDefinitions();
+
+ /**
+ * @return the policyType value.
+ */
+ PolicyType policyType();
+
+ /**
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * The entirety of the PolicySetDefinition definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPolicyDefinitions, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * Grouping of PolicySetDefinition definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of a PolicySetDefinition definition.
+ */
+ interface Blank extends WithPolicyDefinitions {
+ }
+
+ /**
+ * The stage of the policysetdefinition definition allowing to specify PolicyDefinitions.
+ */
+ interface WithPolicyDefinitions {
+ /**
+ * Specifies policyDefinitions.
+ * @param policyDefinitions An array of policy definition references
+ * @return the next definition stage
+ */
+ WithCreate withPolicyDefinitions(List policyDefinitions);
+ }
+
+ /**
+ * The stage of the policysetdefinition definition allowing to specify Description.
+ */
+ interface WithDescription {
+ /**
+ * Specifies description.
+ * @param description The policy set definition description
+ * @return the next definition stage
+ */
+ WithCreate withDescription(String description);
+ }
+
+ /**
+ * The stage of the policysetdefinition definition allowing to specify DisplayName.
+ */
+ interface WithDisplayName {
+ /**
+ * Specifies displayName.
+ * @param displayName The display name of the policy set definition
+ * @return the next definition stage
+ */
+ WithCreate withDisplayName(String displayName);
+ }
+
+ /**
+ * The stage of the policysetdefinition definition allowing to specify Metadata.
+ */
+ interface WithMetadata {
+ /**
+ * Specifies metadata.
+ * @param metadata The policy set definition metadata
+ * @return the next definition stage
+ */
+ WithCreate withMetadata(Object metadata);
+ }
+
+ /**
+ * The stage of the policysetdefinition definition allowing to specify Parameters.
+ */
+ interface WithParameters {
+ /**
+ * Specifies parameters.
+ * @param parameters The policy set definition parameters that can be used in policy definition references
+ * @return the next definition stage
+ */
+ WithCreate withParameters(Object parameters);
+ }
+
+ /**
+ * The stage of the policysetdefinition definition allowing to specify PolicyType.
+ */
+ interface WithPolicyType {
+ /**
+ * Specifies policyType.
+ * @param policyType The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom'
+ * @return the next definition stage
+ */
+ WithCreate withPolicyType(PolicyType policyType);
+ }
+
+ /**
+ * The stage of the definition which contains all the minimum required inputs for
+ * the resource to be created (via {@link WithCreate#create()}), but also allows
+ * for any other optional settings to be specified.
+ */
+ interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithDisplayName, DefinitionStages.WithMetadata, DefinitionStages.WithParameters, DefinitionStages.WithPolicyType {
+ }
+ }
+ /**
+ * The template for a PolicySetDefinition update operation, containing all the settings that can be modified.
+ */
+ interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithDisplayName, UpdateStages.WithMetadata, UpdateStages.WithParameters, UpdateStages.WithPolicyType {
+ }
+
+ /**
+ * Grouping of PolicySetDefinition update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the policysetdefinition update allowing to specify Description.
+ */
+ interface WithDescription {
+ /**
+ * Specifies description.
+ * @param description The policy set definition description
+ * @return the next update stage
+ */
+ Update withDescription(String description);
+ }
+
+ /**
+ * The stage of the policysetdefinition update allowing to specify DisplayName.
+ */
+ interface WithDisplayName {
+ /**
+ * Specifies displayName.
+ * @param displayName The display name of the policy set definition
+ * @return the next update stage
+ */
+ Update withDisplayName(String displayName);
+ }
+
+ /**
+ * The stage of the policysetdefinition update allowing to specify Metadata.
+ */
+ interface WithMetadata {
+ /**
+ * Specifies metadata.
+ * @param metadata The policy set definition metadata
+ * @return the next update stage
+ */
+ Update withMetadata(Object metadata);
+ }
+
+ /**
+ * The stage of the policysetdefinition update allowing to specify Parameters.
+ */
+ interface WithParameters {
+ /**
+ * Specifies parameters.
+ * @param parameters The policy set definition parameters that can be used in policy definition references
+ * @return the next update stage
+ */
+ Update withParameters(Object parameters);
+ }
+
+ /**
+ * The stage of the policysetdefinition update allowing to specify PolicyType.
+ */
+ interface WithPolicyType {
+ /**
+ * Specifies policyType.
+ * @param policyType The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom'
+ * @return the next update stage
+ */
+ Update withPolicyType(PolicyType policyType);
+ }
+
+ }
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySetDefinitions.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySetDefinitions.java
new file mode 100644
index 0000000000000..e50a4e380e269
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySetDefinitions.java
@@ -0,0 +1,106 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.microsoft.azure.arm.collection.SupportsCreating;
+import com.microsoft.azure.arm.collection.SupportsListing;
+import rx.Completable;
+import rx.Observable;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicySetDefinitionInner;
+import com.microsoft.azure.management.policy.v2019_01_01.implementation.PolicySetDefinitionsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing PolicySetDefinitions.
+ */
+public interface PolicySetDefinitions extends SupportsCreating, SupportsListing, HasInner {
+ /**
+ * 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
+ * @return the observable for the request
+ */
+ Completable deleteAsync(String policySetDefinitionName);
+
+ /**
+ * 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
+ * @return the observable for the request
+ */
+ Observable getAsync(String policySetDefinitionName);
+
+ /**
+ * 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
+ * @return the observable for the request
+ */
+ Observable getBuiltInAsync(String policySetDefinitionName);
+
+ /**
+ * 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.
+ * @param parameters The policy set definition properties.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable createOrUpdateAtManagementGroupAsync(String policySetDefinitionName, String managementGroupId, PolicySetDefinitionInner parameters);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Completable deleteAtManagementGroupAsync(String policySetDefinitionName, String managementGroupId);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable getAtManagementGroupAsync(String policySetDefinitionName, String managementGroupId);
+
+ /**
+ * 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
+ * @return the observable for the request
+ */
+ Observable listByManagementGroupAsync(final String managementGroupId);
+
+ /**
+ * 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 for the request
+ */
+ Observable listBuiltInAsync();
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySku.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySku.java
new file mode 100644
index 0000000000000..d0712cbe8606e
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicySku.java
@@ -0,0 +1,69 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The policy sku. This property is optional, obsolete, and will be ignored.
+ */
+public class PolicySku {
+ /**
+ * The name of the policy sku. Possible values are A0 and A1.
+ */
+ @JsonProperty(value = "name", required = true)
+ private String name;
+
+ /**
+ * The policy sku tier. Possible values are Free and Standard.
+ */
+ @JsonProperty(value = "tier")
+ private String tier;
+
+ /**
+ * Get the name of the policy sku. Possible values are A0 and A1.
+ *
+ * @return the name value
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name of the policy sku. Possible values are A0 and A1.
+ *
+ * @param name the name value to set
+ * @return the PolicySku object itself.
+ */
+ public PolicySku withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the policy sku tier. Possible values are Free and Standard.
+ *
+ * @return the tier value
+ */
+ public String tier() {
+ return this.tier;
+ }
+
+ /**
+ * Set the policy sku tier. Possible values are Free and Standard.
+ *
+ * @param tier the tier value to set
+ * @return the PolicySku object itself.
+ */
+ public PolicySku withTier(String tier) {
+ this.tier = tier;
+ return this;
+ }
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyType.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyType.java
new file mode 100644
index 0000000000000..8dded63d019de
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/PolicyType.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policy.v2019_01_01;
+
+import java.util.Collection;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.microsoft.rest.ExpandableStringEnum;
+
+/**
+ * Defines values for PolicyType.
+ */
+public final class PolicyType extends ExpandableStringEnum {
+ /** Static value NotSpecified for PolicyType. */
+ public static final PolicyType NOT_SPECIFIED = fromString("NotSpecified");
+
+ /** Static value BuiltIn for PolicyType. */
+ public static final PolicyType BUILT_IN = fromString("BuiltIn");
+
+ /** Static value Custom for PolicyType. */
+ public static final PolicyType CUSTOM = fromString("Custom");
+
+ /**
+ * Creates or finds a PolicyType from its string representation.
+ * @param name a name to look for
+ * @return the corresponding PolicyType
+ */
+ @JsonCreator
+ public static PolicyType fromString(String name) {
+ return fromString(name, PolicyType.class);
+ }
+
+ /**
+ * @return known PolicyType values
+ */
+ public static Collection values() {
+ return values(PolicyType.class);
+ }
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ResourceIdentityType.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ResourceIdentityType.java
new file mode 100644
index 0000000000000..37a8699009bab
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/ResourceIdentityType.java
@@ -0,0 +1,53 @@
+/**
+ * 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.policy.v2019_01_01;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for ResourceIdentityType.
+ */
+public enum ResourceIdentityType {
+ /** Enum value SystemAssigned. */
+ SYSTEM_ASSIGNED("SystemAssigned"),
+
+ /** Enum value None. */
+ NONE("None");
+
+ /** The actual serialized value for a ResourceIdentityType instance. */
+ private String value;
+
+ ResourceIdentityType(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a ResourceIdentityType instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed ResourceIdentityType object, or null if unable to parse.
+ */
+ @JsonCreator
+ public static ResourceIdentityType fromString(String value) {
+ ResourceIdentityType[] items = ResourceIdentityType.values();
+ for (ResourceIdentityType item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/IdParsingUtils.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/IdParsingUtils.java
new file mode 100644
index 0000000000000..72fd6a90d50b9
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/IdParsingUtils.java
@@ -0,0 +1,57 @@
+/**
+ * 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.policy.v2019_01_01.implementation;
+import java.util.Arrays;
+import java.util.Iterator;
+
+class IdParsingUtils {
+ public static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterable iterable = Arrays.asList(id.split("/"));
+ Iterator itr = iterable.iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && part.trim() != "") {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static String getValueFromIdByPosition(String id, int pos) {
+ if (id == null) {
+ return null;
+ }
+ Iterable iterable = Arrays.asList(id.split("/"));
+ Iterator itr = iterable.iterator();
+ int index = 0;
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && part.trim() != "") {
+ if (index == pos) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ index++;
+ }
+ return null;
+ }
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PageImpl.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PageImpl.java
new file mode 100644
index 0000000000000..e879fe27cd886
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PageImpl.java
@@ -0,0 +1,75 @@
+/**
+ * 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.policy.v2019_01_01.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.azure.Page;
+import java.util.List;
+
+/**
+ * An instance of this class defines a page of Azure resources and a link to
+ * get the next page of resources, if any.
+ *
+ * @param type of Azure resource
+ */
+public class PageImpl implements Page {
+ /**
+ * The link to the next page.
+ */
+ @JsonProperty("nextLink")
+ private String nextPageLink;
+
+ /**
+ * The list of items.
+ */
+ @JsonProperty("value")
+ private List items;
+
+ /**
+ * Gets the link to the next page.
+ *
+ * @return the link to the next page.
+ */
+ @Override
+ public String nextPageLink() {
+ return this.nextPageLink;
+ }
+
+ /**
+ * Gets the list of items.
+ *
+ * @return the list of items in {@link List}.
+ */
+ @Override
+ public List items() {
+ return items;
+ }
+
+ /**
+ * Sets the link to the next page.
+ *
+ * @param nextPageLink the link to the next page.
+ * @return this Page object itself.
+ */
+ public PageImpl setNextPageLink(String nextPageLink) {
+ this.nextPageLink = nextPageLink;
+ return this;
+ }
+
+ /**
+ * Sets the list of items.
+ *
+ * @param items the list of items in {@link List}.
+ * @return this Page object itself.
+ */
+ public PageImpl setItems(List items) {
+ this.items = items;
+ return this;
+ }
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentImpl.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentImpl.java
new file mode 100644
index 0000000000000..16f13c1fd2cc6
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentImpl.java
@@ -0,0 +1,205 @@
+/**
+ * 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.policy.v2019_01_01.implementation;
+
+import com.microsoft.azure.management.policy.v2019_01_01.PolicyAssignment;
+import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl;
+import rx.Observable;
+import java.util.List;
+import com.microsoft.azure.management.policy.v2019_01_01.PolicySku;
+import com.microsoft.azure.management.policy.v2019_01_01.Identity;
+
+class PolicyAssignmentImpl extends CreatableUpdatableImpl implements PolicyAssignment, PolicyAssignment.Definition, PolicyAssignment.Update {
+ private String scope;
+ private String policyAssignmentName;
+ private final PolicyManager manager;
+
+ PolicyAssignmentImpl(String name, PolicyManager manager) {
+ super(name, new PolicyAssignmentInner());
+ this.manager = manager;
+ // Set resource name
+ this.policyAssignmentName = name;
+ //
+ }
+
+ PolicyAssignmentImpl(PolicyAssignmentInner inner, PolicyManager manager) {
+ super(inner.name(), inner);
+ this.manager = manager;
+ // Set resource name
+ this.policyAssignmentName = inner.name();
+ // set resource ancestor and positional variables
+ this.policyAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "policyAssignments");
+ this.scope = IdParsingUtils.getValueFromIdByPosition(inner.id(), 0);
+ // set other parameters for create and update
+ }
+
+ @Override
+ public PolicyManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public Observable createResourceAsync() {
+ PolicyAssignmentsInner client = this.manager().inner().policyAssignments();
+ return client.createAsync(this.scope, this.policyAssignmentName, this.inner())
+ .map(innerToFluentMap(this));
+ }
+
+ @Override
+ public Observable updateResourceAsync() {
+ PolicyAssignmentsInner client = this.manager().inner().policyAssignments();
+ return client.createAsync(this.scope, this.policyAssignmentName, this.inner())
+ .map(innerToFluentMap(this));
+ }
+
+ @Override
+ protected Observable getInnerAsync() {
+ PolicyAssignmentsInner client = this.manager().inner().policyAssignments();
+ return client.getAsync(this.scope, this.policyAssignmentName);
+ }
+
+ @Override
+ public boolean isInCreateMode() {
+ return this.inner().id() == null;
+ }
+
+
+ @Override
+ public String description() {
+ return this.inner().description();
+ }
+
+ @Override
+ public String displayName() {
+ return this.inner().displayName();
+ }
+
+ @Override
+ public String id() {
+ return this.inner().id();
+ }
+
+ @Override
+ public Identity identity() {
+ return this.inner().identity();
+ }
+
+ @Override
+ public String location() {
+ return this.inner().location();
+ }
+
+ @Override
+ public Object metadata() {
+ return this.inner().metadata();
+ }
+
+ @Override
+ public String name() {
+ return this.inner().name();
+ }
+
+ @Override
+ public List notScopes() {
+ return this.inner().notScopes();
+ }
+
+ @Override
+ public Object parameters() {
+ return this.inner().parameters();
+ }
+
+ @Override
+ public String policyDefinitionId() {
+ return this.inner().policyDefinitionId();
+ }
+
+ @Override
+ public String scopeProperty() {
+ return this.inner().scopeProperty();
+ }
+
+ @Override
+ public PolicySku sku() {
+ return this.inner().sku();
+ }
+
+ @Override
+ public String type() {
+ return this.inner().type();
+ }
+
+ @Override
+ public PolicyAssignmentImpl withScope(String scope) {
+ this.scope = scope;
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withDescription(String description) {
+ this.inner().withDescription(description);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withDisplayName(String displayName) {
+ this.inner().withDisplayName(displayName);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withIdentity(Identity identity) {
+ this.inner().withIdentity(identity);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withLocation(String location) {
+ this.inner().withLocation(location);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withMetadata(Object metadata) {
+ this.inner().withMetadata(metadata);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withNotScopes(List notScopes) {
+ this.inner().withNotScopes(notScopes);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withParameters(Object parameters) {
+ this.inner().withParameters(parameters);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withPolicyDefinitionId(String policyDefinitionId) {
+ this.inner().withPolicyDefinitionId(policyDefinitionId);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withScopeProperty(String scopeProperty) {
+ this.inner().withScopeProperty(scopeProperty);
+ return this;
+ }
+
+ @Override
+ public PolicyAssignmentImpl withSku(PolicySku sku) {
+ this.inner().withSku(sku);
+ return this;
+ }
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentInner.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentInner.java
new file mode 100644
index 0000000000000..3efad60de8763
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentInner.java
@@ -0,0 +1,285 @@
+/**
+ * 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.policy.v2019_01_01.implementation;
+
+import java.util.List;
+import com.microsoft.azure.management.policy.v2019_01_01.PolicySku;
+import com.microsoft.azure.management.policy.v2019_01_01.Identity;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+import com.microsoft.azure.ProxyResource;
+
+/**
+ * The policy assignment.
+ */
+@JsonFlatten
+public class PolicyAssignmentInner extends ProxyResource {
+ /**
+ * The display name of the policy assignment.
+ */
+ @JsonProperty(value = "properties.displayName")
+ private String displayName;
+
+ /**
+ * The ID of the policy definition or policy set definition being assigned.
+ */
+ @JsonProperty(value = "properties.policyDefinitionId")
+ private String policyDefinitionId;
+
+ /**
+ * The scope for the policy assignment.
+ */
+ @JsonProperty(value = "properties.scope")
+ private String scopeProperty;
+
+ /**
+ * 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 policy sku. This property is optional, obsolete, and will be
+ * ignored.
+ */
+ @JsonProperty(value = "sku")
+ private PolicySku sku;
+
+ /**
+ * The location of the policy assignment. Only required when utilizing
+ * managed identity.
+ */
+ @JsonProperty(value = "location")
+ private String location;
+
+ /**
+ * The managed identity associated with the policy assignment.
+ */
+ @JsonProperty(value = "identity")
+ private Identity identity;
+
+ /**
+ * Get the display name of the policy assignment.
+ *
+ * @return the displayName value
+ */
+ public String displayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Set the display name of the policy assignment.
+ *
+ * @param displayName the displayName value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withDisplayName(String displayName) {
+ this.displayName = displayName;
+ return this;
+ }
+
+ /**
+ * Get the ID of the policy definition or policy set definition being assigned.
+ *
+ * @return the policyDefinitionId value
+ */
+ public String policyDefinitionId() {
+ return this.policyDefinitionId;
+ }
+
+ /**
+ * Set the ID of the policy definition or policy set definition being assigned.
+ *
+ * @param policyDefinitionId the policyDefinitionId value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withPolicyDefinitionId(String policyDefinitionId) {
+ this.policyDefinitionId = policyDefinitionId;
+ return this;
+ }
+
+ /**
+ * Get the scope for the policy assignment.
+ *
+ * @return the scopeProperty value
+ */
+ public String scopeProperty() {
+ return this.scopeProperty;
+ }
+
+ /**
+ * Set the scope for the policy assignment.
+ *
+ * @param scopeProperty the scopeProperty value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withScopeProperty(String scopeProperty) {
+ this.scopeProperty = scopeProperty;
+ return this;
+ }
+
+ /**
+ * Get the policy's excluded scopes.
+ *
+ * @return the notScopes value
+ */
+ public List notScopes() {
+ return this.notScopes;
+ }
+
+ /**
+ * Set the policy's excluded scopes.
+ *
+ * @param notScopes the notScopes value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withNotScopes(List notScopes) {
+ this.notScopes = notScopes;
+ return this;
+ }
+
+ /**
+ * Get required if a parameter is used in policy rule.
+ *
+ * @return the parameters value
+ */
+ public Object parameters() {
+ return this.parameters;
+ }
+
+ /**
+ * Set required if a parameter is used in policy rule.
+ *
+ * @param parameters the parameters value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withParameters(Object parameters) {
+ this.parameters = parameters;
+ return this;
+ }
+
+ /**
+ * Get this message will be part of response in case of policy violation.
+ *
+ * @return the description value
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Set this message will be part of response in case of policy violation.
+ *
+ * @param description the description value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Get the policy assignment metadata.
+ *
+ * @return the metadata value
+ */
+ public Object metadata() {
+ return this.metadata;
+ }
+
+ /**
+ * Set the policy assignment metadata.
+ *
+ * @param metadata the metadata value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withMetadata(Object metadata) {
+ this.metadata = metadata;
+ return this;
+ }
+
+ /**
+ * Get the policy sku. This property is optional, obsolete, and will be ignored.
+ *
+ * @return the sku value
+ */
+ public PolicySku sku() {
+ return this.sku;
+ }
+
+ /**
+ * Set the policy sku. This property is optional, obsolete, and will be ignored.
+ *
+ * @param sku the sku value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withSku(PolicySku sku) {
+ this.sku = sku;
+ return this;
+ }
+
+ /**
+ * Get the location of the policy assignment. Only required when utilizing managed identity.
+ *
+ * @return the location value
+ */
+ public String location() {
+ return this.location;
+ }
+
+ /**
+ * Set the location of the policy assignment. Only required when utilizing managed identity.
+ *
+ * @param location the location value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ /**
+ * Get the managed identity associated with the policy assignment.
+ *
+ * @return the identity value
+ */
+ public Identity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the managed identity associated with the policy assignment.
+ *
+ * @param identity the identity value to set
+ * @return the PolicyAssignmentInner object itself.
+ */
+ public PolicyAssignmentInner withIdentity(Identity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentsImpl.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentsImpl.java
new file mode 100644
index 0000000000000..2686ec7800e74
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentsImpl.java
@@ -0,0 +1,179 @@
+/**
+ * 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.
+ * jkl
+ */
+
+package com.microsoft.azure.management.policy.v2019_01_01.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.policy.v2019_01_01.PolicyAssignments;
+import rx.Observable;
+import rx.functions.Func1;
+import com.microsoft.azure.PagedList;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.management.policy.v2019_01_01.PolicyAssignment;
+import com.microsoft.azure.arm.utils.PagedListConverter;
+
+class PolicyAssignmentsImpl extends WrapperImpl implements PolicyAssignments {
+ private PagedListConverter converter;
+ private final PolicyManager manager;
+
+ PolicyAssignmentsImpl(PolicyManager manager) {
+ super(manager.inner().policyAssignments());
+ this.manager = manager;
+ this.converter = new PagedListConverter() {
+ @Override
+ public Observable typeConvertAsync(PolicyAssignmentInner inner) {
+ return Observable.just((PolicyAssignment) wrapModel(inner));
+ }
+ };
+ }
+
+ public PolicyManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public PolicyAssignmentImpl define(String name) {
+ return wrapModel(name);
+ }
+
+ private PolicyAssignmentImpl wrapModel(PolicyAssignmentInner inner) {
+ return new PolicyAssignmentImpl(inner, manager());
+ }
+
+ private PolicyAssignmentImpl wrapModel(String name) {
+ return new PolicyAssignmentImpl(name, this.manager());
+ }
+
+ @Override
+ public Observable deleteAsync(String scope, String policyAssignmentName) {
+ PolicyAssignmentsInner client = this.inner();
+ return client.deleteAsync(scope, policyAssignmentName)
+ .map(new Func1() {
+ @Override
+ public PolicyAssignment call(PolicyAssignmentInner inner) {
+ return new PolicyAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable getAsync(String scope, String policyAssignmentName) {
+ PolicyAssignmentsInner client = this.inner();
+ return client.getAsync(scope, policyAssignmentName)
+ .map(new Func1() {
+ @Override
+ public PolicyAssignment call(PolicyAssignmentInner inner) {
+ return new PolicyAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) {
+ PolicyAssignmentsInner client = this.inner();
+ return client.listForResourceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ .flatMapIterable(new Func1, Iterable>() {
+ @Override
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PolicyAssignment call(PolicyAssignmentInner inner) {
+ return new PolicyAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable deleteByIdAsync(String policyAssignmentId) {
+ PolicyAssignmentsInner client = this.inner();
+ return client.deleteByIdAsync(policyAssignmentId)
+ .map(new Func1() {
+ @Override
+ public PolicyAssignment call(PolicyAssignmentInner inner) {
+ return new PolicyAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters) {
+ PolicyAssignmentsInner client = this.inner();
+ return client.createByIdAsync(policyAssignmentId, parameters)
+ .map(new Func1() {
+ @Override
+ public PolicyAssignment call(PolicyAssignmentInner inner) {
+ return new PolicyAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable getByIdAsync(String policyAssignmentId) {
+ PolicyAssignmentsInner client = this.inner();
+ return client.getByIdAsync(policyAssignmentId)
+ .map(new Func1() {
+ @Override
+ public PolicyAssignment call(PolicyAssignmentInner inner) {
+ return new PolicyAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public PagedList list() {
+ PolicyAssignmentsInner client = this.inner();
+ return converter.convert(client.list());
+ }
+
+ @Override
+ public Observable listAsync() {
+ PolicyAssignmentsInner client = this.inner();
+ return client.listAsync()
+ .flatMapIterable(new Func1, Iterable>() {
+ @Override
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PolicyAssignment call(PolicyAssignmentInner inner) {
+ return wrapModel(inner);
+ }
+ });
+ }
+
+ @Override
+ public PagedList listByResourceGroup(String resourceGroupName) {
+ PolicyAssignmentsInner client = this.inner();
+ return converter.convert(client.listByResourceGroup(resourceGroupName));
+ }
+
+ @Override
+ public Observable listByResourceGroupAsync(String resourceGroupName) {
+ PolicyAssignmentsInner client = this.inner();
+ return client.listByResourceGroupAsync(resourceGroupName)
+ .flatMapIterable(new Func1, Iterable>() {
+ @Override
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PolicyAssignment call(PolicyAssignmentInner inner) {
+ return wrapModel(inner);
+ }
+ });
+ }
+
+}
diff --git a/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentsInner.java b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentsInner.java
new file mode 100644
index 0000000000000..c21376ad3fe56
--- /dev/null
+++ b/sdk/policy/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/policy/v2019_01_01/implementation/PolicyAssignmentsInner.java
@@ -0,0 +1,1748 @@
+/**
+ * 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.policy.v2019_01_01.implementation;
+
+import com.microsoft.azure.arm.collection.InnerSupportsDelete;
+import com.microsoft.azure.arm.collection.InnerSupportsListing;
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.AzureServiceFuture;
+import com.microsoft.azure.ListOperationCallback;
+import com.microsoft.azure.management.policy.v2019_01_01.ErrorResponseException;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.PagedList;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import com.microsoft.rest.Validator;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.ResponseBody;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.HTTP;
+import retrofit2.http.Path;
+import retrofit2.http.PUT;
+import retrofit2.http.Query;
+import retrofit2.http.Url;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in PolicyAssignments.
+ */
+public class PolicyAssignmentsInner implements InnerSupportsDelete, InnerSupportsListing {
+ /** The Retrofit service to perform REST calls. */
+ private PolicyAssignmentsService service;
+ /** The service client containing this operation class. */
+ private PolicyClientImpl client;
+
+ /**
+ * Initializes an instance of PolicyAssignmentsInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public PolicyAssignmentsInner(Retrofit retrofit, PolicyClientImpl client) {
+ this.service = retrofit.create(PolicyAssignmentsService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for PolicyAssignments to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface PolicyAssignmentsService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policy.v2019_01_01.PolicyAssignments delete" })
+ @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.policy.v2019_01_01.PolicyAssignments create" })
+ @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.policy.v2019_01_01.PolicyAssignments get" })
+ @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.policy.v2019_01_01.PolicyAssignments listByResourceGroup" })
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments")
+ 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.policy.v2019_01_01.PolicyAssignments listForResource" })
+ @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.policy.v2019_01_01.PolicyAssignments list" })
+ @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.policy.v2019_01_01.PolicyAssignments deleteById" })
+ @HTTP(path = "{policyAssignmentId}", method = "DELETE", hasBody = true)
+ Observable> deleteById(@Path(value = "policyAssignmentId", encoded = true) String policyAssignmentId, @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.policy.v2019_01_01.PolicyAssignments createById" })
+ @PUT("{policyAssignmentId}")
+ Observable> createById(@Path(value = "policyAssignmentId", encoded = true) String policyAssignmentId, @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.policy.v2019_01_01.PolicyAssignments getById" })
+ @GET("{policyAssignmentId}")
+ Observable> getById(@Path(value = "policyAssignmentId", encoded = true) String policyAssignmentId, @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.policy.v2019_01_01.PolicyAssignments listByResourceGroupNext" })
+ @GET
+ Observable> listByResourceGroupNext(@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.policy.v2019_01_01.PolicyAssignments listForResourceNext" })
+ @GET
+ Observable> listForResourceNext(@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.policy.v2019_01_01.PolicyAssignments listNext" })
+ @GET
+ Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * 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. 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 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.
+ */
+ public PolicyAssignmentInner delete(String scope, String policyAssignmentName) {
+ return deleteWithServiceResponseAsync(scope, policyAssignmentName).toBlocking().single().body();
+ }
+
+ /**
+ * 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. 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
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture deleteAsync(String scope, String policyAssignmentName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(scope, policyAssignmentName), serviceCallback);
+ }
+
+ /**
+ * 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. 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
+ */
+ public Observable deleteAsync(String scope, String policyAssignmentName) {
+ return deleteWithServiceResponseAsync(scope, policyAssignmentName).map(new Func1, PolicyAssignmentInner>() {
+ @Override
+ public PolicyAssignmentInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * 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. 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
+ */
+ public Observable> deleteWithServiceResponseAsync(String scope, String policyAssignmentName) {
+ if (scope == null) {
+ throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
+ }
+ if (policyAssignmentName == null) {
+ throw new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.delete(scope, policyAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = deleteDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .register(204, new TypeToken() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * 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. 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 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.
+ */
+ public PolicyAssignmentInner create(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
+ return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).toBlocking().single().body();
+ }
+
+ /**
+ * 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. 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(createWithServiceResponseAsync(scope, policyAssignmentName, parameters), serviceCallback);
+ }
+
+ /**
+ * 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. 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
+ * @return the observable to the PolicyAssignmentInner object
+ */
+ public Observable createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
+ return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).map(new Func1, PolicyAssignmentInner>() {
+ @Override
+ public PolicyAssignmentInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * 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. 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
+ * @return the observable to the PolicyAssignmentInner object
+ */
+ public Observable> createWithServiceResponseAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
+ if (scope == null) {
+ throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
+ }
+ if (policyAssignmentName == null) {
+ throw new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.");
+ }
+ if (parameters == null) {
+ throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ Validator.validate(parameters);
+ return service.create(scope, policyAssignmentName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = createDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse createDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(201, new TypeToken() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * 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. 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 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.
+ */
+ public PolicyAssignmentInner get(String scope, String policyAssignmentName) {
+ return getWithServiceResponseAsync(scope, policyAssignmentName).toBlocking().single().body();
+ }
+
+ /**
+ * 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. 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
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture getAsync(String scope, String policyAssignmentName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, policyAssignmentName), serviceCallback);
+ }
+
+ /**
+ * 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. 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
+ */
+ public Observable getAsync(String scope, String policyAssignmentName) {
+ return getWithServiceResponseAsync(scope, policyAssignmentName).map(new Func1, PolicyAssignmentInner>() {
+ @Override
+ public PolicyAssignmentInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * 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. 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
+ */
+ public Observable> getWithServiceResponseAsync(String scope, String policyAssignmentName) {
+ if (scope == null) {
+ throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
+ }
+ if (policyAssignmentName == null) {
+ throw new IllegalArgumentException("Parameter policyAssignmentName 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.get(scope, policyAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = getDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @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.
+ */
+ public PagedList listByResourceGroup(final String resourceGroupName) {
+ ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listByResourceGroupSinglePageAsync(resourceGroupName),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listByResourceGroupNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the PagedList<PolicyAssignmentInner> object
+ */
+ public Observable> listByResourceGroupAsync(final String resourceGroupName) {
+ return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the PagedList<PolicyAssignmentInner> object
+ */
+ public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) {
+ return listByResourceGroupSinglePageAsync(resourceGroupName)
+ .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) {
+ if (resourceGroupName == null) {
+ throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
+ }
+ if (this.client.subscriptionId() == null) {
+ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ final String filter = null;
+ return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listByResourceGroupDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @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
+ * @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.
+ */
+ public PagedList listByResourceGroup(final String resourceGroupName, final String filter) {
+ ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @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
+ */
+ public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String filter, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listByResourceGroupSinglePageAsync(resourceGroupName, filter),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listByResourceGroupNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @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
+ */
+ public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter) {
+ return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ * @param resourceGroupName The name of the resource group that contains policy assignments.
+ * @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
+ */
+ public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter) {
+ return listByResourceGroupSinglePageAsync(resourceGroupName, filter)
+ .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource group.
+ *
+ ServiceResponse> * @param resourceGroupName The name of the resource group that contains policy assignments.
+ 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.
+ */
+ public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter) {
+ if (resourceGroupName == null) {
+ throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
+ }
+ if (this.client.subscriptionId() == null) {
+ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listByResourceGroupDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ 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(ErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource. 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.
+ * @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 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.
+ */
+ public PagedList listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) {
+ ServiceResponse> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource. 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.
+ * @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
+ */
+ public ServiceFuture> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listForResourceNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource. 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.
+ * @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
+ */
+ public Observable> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) {
+ return listForResourceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource. 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.
+ * @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
+ */
+ public Observable>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) {
+ return listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ .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(listForResourceNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource. 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.
+ * @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.
+ */
+ public Observable>> listForResourceSinglePageAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) {
+ if (resourceGroupName == null) {
+ throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
+ }
+ if (resourceProviderNamespace == null) {
+ throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.");
+ }
+ if (parentResourcePath == null) {
+ throw new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
+ }
+ if (this.client.subscriptionId() == null) {
+ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ final String filter = null;
+ return service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listForResourceDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ /**
+ * 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 all policy assignments of the policy definition whose id is {value} that apply to the resource. 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.
+ * @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
+ * @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.
+ */
+ public PagedList listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
+ ServiceResponse> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page