/** * Creates a policy assignment. * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. * * @param scope The scope of the policy assignment. * @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<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) { return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() { @Override public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) { return response.body(); } }); }
/** * Creates a policy assignment. * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. * * @param scope The scope of the policy assignment. * @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<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) { return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() { @Override public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) { return response.body(); } }); }
/** * Creates a policy assignment. * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. * * @param scope The scope of the policy assignment. * @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<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters, final ServiceCallback<PolicyAssignmentInner> serviceCallback) { return ServiceFuture.fromResponse(createWithServiceResponseAsync(scope, policyAssignmentName, parameters), serviceCallback); }
/** * Creates a policy assignment. * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. * * @param scope The scope of the policy assignment. * @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<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters, final ServiceCallback<PolicyAssignmentInner> serviceCallback) { return ServiceFuture.fromResponse(createWithServiceResponseAsync(scope, policyAssignmentName, parameters), serviceCallback); }
/** * Creates a policy assignment. * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. * * @param scope The scope of the policy assignment. * @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 a policy assignment. * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. * * @param scope The scope of the policy assignment. * @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(); }