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.
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.resources.implementation;
import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete;
import com.microsoft.azure.management.resources.fluentcore.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.resources.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.
/**
* An instance of this class provides access to all the operations defined
* in PolicyAssignments.
*/
public class PolicyAssignmentsInner implements InnerSupportsDelete<PolicyAssignmentInner>, InnerSupportsListing<PolicyAssignmentInner> {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private PolicyAssignmentsService service;
The service client containing this operation class. /** The service client containing this operation class. */
private PolicyClientImpl client;
Initializes an instance of PolicyAssignmentsInner.
Params: - retrofit – the Retrofit instance built from a Retrofit Builder.
- client – the instance of the service client containing this operation class.
/**
* 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.
/**
* 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.resources.PolicyAssignments delete" })
@HTTP(path = "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> delete(@Path(value = "scope", encoded = true) String scope, @Path("policyAssignmentName") String policyAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyAssignments create" })
@PUT("{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}")
Observable<Response<ResponseBody>> create(@Path(value = "scope", encoded = true) String scope, @Path("policyAssignmentName") String policyAssignmentName, @Body PolicyAssignmentInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyAssignments get" })
@GET("{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}")
Observable<Response<ResponseBody>> get(@Path(value = "scope", encoded = true) String scope, @Path("policyAssignmentName") String policyAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyAssignments listByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments")
Observable<Response<ResponseBody>> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query(value = "$filter", encoded = true) String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyAssignments listForResource" })
@GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments")
Observable<Response<ResponseBody>> listForResource(@Path("resourceGroupName") String resourceGroupName, @Path("resourceProviderNamespace") String resourceProviderNamespace, @Path(value = "parentResourcePath", encoded = true) String parentResourcePath, @Path(value = "resourceType", encoded = true) String resourceType, @Path("resourceName") String resourceName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyAssignments list" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments")
Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.PolicyAssignments deleteById" })
@HTTP(path = "{policyAssignmentId}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> 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.resources.PolicyAssignments createById" })
@PUT("{policyAssignmentId}")
Observable<Response<ResponseBody>> 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.resources.PolicyAssignments getById" })
@GET("{policyAssignmentId}")
Observable<Response<ResponseBody>> 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.resources.PolicyAssignments listByResourceGroupNext" })
@GET
Observable<Response<ResponseBody>> 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.resources.PolicyAssignments listForResourceNext" })
@GET
Observable<Response<ResponseBody>> 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.resources.PolicyAssignments listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Deletes a policy assignment.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment to delete.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PolicyAssignmentInner object if successful.
/**
* Deletes a policy assignment.
*
* @param scope The scope of the policy assignment.
* @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.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment to delete.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes a policy assignment.
*
* @param scope The scope of the policy assignment.
* @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<PolicyAssignmentInner> deleteAsync(String scope, String policyAssignmentName, final ServiceCallback<PolicyAssignmentInner> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(scope, policyAssignmentName), serviceCallback);
}
Deletes a policy assignment.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment to delete.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Deletes a policy assignment.
*
* @param scope The scope of the policy assignment.
* @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<PolicyAssignmentInner> deleteAsync(String scope, String policyAssignmentName) {
return deleteWithServiceResponseAsync(scope, policyAssignmentName).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Override
public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) {
return response.body();
}
});
}
Deletes a policy assignment.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment to delete.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Deletes a policy assignment.
*
* @param scope The scope of the policy assignment.
* @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<ServiceResponse<PolicyAssignmentInner>> 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.");
}
final String apiVersion = "2017-06-01-preview";
return service.delete(scope, policyAssignmentName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PolicyAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<PolicyAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PolicyAssignmentInner> clientResponse = deleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PolicyAssignmentInner> deleteDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PolicyAssignmentInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PolicyAssignmentInner>() { }.getType())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment.
- parameters – Parameters for the policy assignment.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PolicyAssignmentInner object if successful.
/**
* 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.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment.
- parameters – Parameters for the policy assignment.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment.
- parameters – Parameters for the policy assignment.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* 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.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment.
- parameters – Parameters for the policy assignment.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* 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<ServiceResponse<PolicyAssignmentInner>> 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.");
}
Validator.validate(parameters);
final String apiVersion = "2017-06-01-preview";
return service.create(scope, policyAssignmentName, parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PolicyAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<PolicyAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PolicyAssignmentInner> clientResponse = createDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PolicyAssignmentInner> createDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PolicyAssignmentInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(201, new TypeToken<PolicyAssignmentInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets a policy assignment.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment to get.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PolicyAssignmentInner object if successful.
/**
* Gets a policy assignment.
*
* @param scope The scope of the policy assignment.
* @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();
}
Gets a policy assignment.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment to get.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a policy assignment.
*
* @param scope The scope of the policy assignment.
* @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<PolicyAssignmentInner> getAsync(String scope, String policyAssignmentName, final ServiceCallback<PolicyAssignmentInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, policyAssignmentName), serviceCallback);
}
Gets a policy assignment.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment to get.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Gets a policy assignment.
*
* @param scope The scope of the policy assignment.
* @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<PolicyAssignmentInner> getAsync(String scope, String policyAssignmentName) {
return getWithServiceResponseAsync(scope, policyAssignmentName).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Override
public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) {
return response.body();
}
});
}
Gets a policy assignment.
Params: - scope – The scope of the policy assignment.
- policyAssignmentName – The name of the policy assignment to get.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Gets a policy assignment.
*
* @param scope The scope of the policy assignment.
* @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<ServiceResponse<PolicyAssignmentInner>> 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.");
}
final String apiVersion = "2017-06-01-preview";
return service.get(scope, policyAssignmentName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PolicyAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<PolicyAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PolicyAssignmentInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PolicyAssignmentInner> getDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PolicyAssignmentInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PolicyAssignmentInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets policy assignments for 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<PolicyAssignmentInner> listByResourceGroup(final String resourceGroupName) {
ServiceResponse<Page<PolicyAssignmentInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets policy assignments for 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<List<PolicyAssignmentInner>> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByResourceGroupSinglePageAsync(resourceGroupName),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for 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<Page<PolicyAssignmentInner>> listByResourceGroupAsync(final String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for 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<ServiceResponse<Page<PolicyAssignmentInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) {
return listByResourceGroupSinglePageAsync(resourceGroupName)
.concatMap(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets policy assignments for 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<ServiceResponse<Page<PolicyAssignmentInner>>> 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.");
}
final String apiVersion = "2017-06-01-preview";
final String filter = null;
return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listByResourceGroupDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
- filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets policy assignments for the resource group.
*
* @param resourceGroupName The name of the resource group that contains policy assignments.
* @param filter The filter to apply on the operation.
* @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<PolicyAssignmentInner> listByResourceGroup(final String resourceGroupName, final String filter) {
ServiceResponse<Page<PolicyAssignmentInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter).toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
- filter – The filter to apply on the operation.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets policy assignments for the resource group.
*
* @param resourceGroupName The name of the resource group that contains policy assignments.
* @param filter The filter to apply on the operation.
* @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<List<PolicyAssignmentInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByResourceGroupSinglePageAsync(resourceGroupName, filter),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
- filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for the resource group.
*
* @param resourceGroupName The name of the resource group that contains policy assignments.
* @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<Page<PolicyAssignmentInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter)
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets policy assignments for the resource group.
Params: - resourceGroupName – The name of the resource group that contains policy assignments.
- filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for the resource group.
*
* @param resourceGroupName The name of the resource group that contains policy assignments.
* @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter) {
return listByResourceGroupSinglePageAsync(resourceGroupName, filter)
.concatMap(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets policy assignments for 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.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets policy assignments for the resource group.
*
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param resourceGroupName The name of the resource group that contains policy assignments.
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> 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.");
}
final String apiVersion = "2017-06-01-preview";
return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listByResourceGroupDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<PolicyAssignmentInner>> listByResourceGroupDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<PolicyAssignmentInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<PolicyAssignmentInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @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<PolicyAssignmentInner> listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName) {
ServiceResponse<Page<PolicyAssignmentInner>> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName).toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @param 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<List<PolicyAssignmentInner>> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listForResourceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<Page<PolicyAssignmentInner>> 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<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> 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<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> 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.");
}
final String apiVersion = "2017-06-01-preview";
final String filter = null;
return service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listForResourceDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
- filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @param filter The filter to apply on the operation.
* @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<PolicyAssignmentInner> listForResource(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
ServiceResponse<Page<PolicyAssignmentInner>> response = listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter).toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
- filter – The filter to apply on the operation.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @param filter The filter to apply on the operation.
* @param 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<List<PolicyAssignmentInner>> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter, final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listForResourceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
- filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<Page<PolicyAssignmentInner>> listForResourceAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
return listForResourceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets policy assignments for a resource.
Params: - resourceGroupName – The name of the resource group containing the resource. The name is case insensitive.
- resourceProviderNamespace – The namespace of the resource provider.
- parentResourcePath – The parent resource path.
- resourceType – The resource type.
- resourceName – The name of the resource with policy assignments.
- filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for a resource.
*
* @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
* @param resourceProviderNamespace The namespace of the resource provider.
* @param parentResourcePath The parent resource path.
* @param resourceType The resource type.
* @param resourceName The name of the resource with policy assignments.
* @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
return listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
.concatMap(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets policy assignments for a resource.
ServiceResponse> * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
ServiceResponse> * @param resourceProviderNamespace The namespace of the resource provider.
ServiceResponse> * @param parentResourcePath The parent resource path.
ServiceResponse> * @param resourceType The resource type.
ServiceResponse> * @param resourceName The name of the resource with policy assignments.
ServiceResponse> * @param filter The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets policy assignments for a resource.
*
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param resourceProviderNamespace The namespace of the resource provider.
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param parentResourcePath The parent resource path.
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param resourceType The resource type.
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param resourceName The name of the resource with policy assignments.
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listForResourceSinglePageAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
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.");
}
final String apiVersion = "2017-06-01-preview";
return service.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listForResourceDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<PolicyAssignmentInner>> listForResourceDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<PolicyAssignmentInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<PolicyAssignmentInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets all the policy assignments for a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets all the policy assignments for a subscription.
*
* @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<PolicyAssignmentInner> list() {
ServiceResponse<Page<PolicyAssignmentInner>> response = listSinglePageAsync().toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all the policy assignments for a subscription.
Params: - serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all the policy assignments for a subscription.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<PolicyAssignmentInner>> listAsync(final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all the policy assignments for a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets all the policy assignments for a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<Page<PolicyAssignmentInner>> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets all the policy assignments for a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets all the policy assignments for a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listWithServiceResponseAsync() {
return listSinglePageAsync()
.concatMap(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets all the policy assignments for a subscription.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all the policy assignments for a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listSinglePageAsync() {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2017-06-01-preview";
final String filter = null;
return service.list(this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Gets all the policy assignments for a subscription.
Params: - filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets all the policy assignments for a subscription.
*
* @param filter The filter to apply on the operation.
* @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<PolicyAssignmentInner> list(final String filter) {
ServiceResponse<Page<PolicyAssignmentInner>> response = listSinglePageAsync(filter).toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all the policy assignments for a subscription.
Params: - filter – The filter to apply on the operation.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all the policy assignments for a subscription.
*
* @param filter The filter to apply on the operation.
* @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<List<PolicyAssignmentInner>> listAsync(final String filter, final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(filter),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all the policy assignments for a subscription.
Params: - filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets all the policy assignments for a subscription.
*
* @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<Page<PolicyAssignmentInner>> listAsync(final String filter) {
return listWithServiceResponseAsync(filter)
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets all the policy assignments for a subscription.
Params: - filter – The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets all the policy assignments for a subscription.
*
* @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listWithServiceResponseAsync(final String filter) {
return listSinglePageAsync(filter)
.concatMap(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets all the policy assignments for a subscription.
ServiceResponse> * @param filter The filter to apply on the operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all the policy assignments for a subscription.
*
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param filter The filter to apply on the operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listSinglePageAsync(final String filter) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2017-06-01-preview";
return service.list(this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<PolicyAssignmentInner>> listDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<PolicyAssignmentInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<PolicyAssignmentInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Deletes a policy assignment by ID.
When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PolicyAssignmentInner object if successful.
/**
* Deletes a policy assignment by ID.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @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 deleteById(String policyAssignmentId) {
return deleteByIdWithServiceResponseAsync(policyAssignmentId).toBlocking().single().body();
}
Deletes a policy assignment by ID.
When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes a policy assignment by ID.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @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> deleteByIdAsync(String policyAssignmentId, final ServiceCallback<PolicyAssignmentInner> serviceCallback) {
return ServiceFuture.fromResponse(deleteByIdWithServiceResponseAsync(policyAssignmentId), serviceCallback);
}
Deletes a policy assignment by ID.
When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Deletes a policy assignment by ID.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PolicyAssignmentInner object
*/
public Observable<PolicyAssignmentInner> deleteByIdAsync(String policyAssignmentId) {
return deleteByIdWithServiceResponseAsync(policyAssignmentId).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Override
public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) {
return response.body();
}
});
}
Deletes a policy assignment by ID.
When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Deletes a policy assignment by ID.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to delete. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PolicyAssignmentInner object
*/
public Observable<ServiceResponse<PolicyAssignmentInner>> deleteByIdWithServiceResponseAsync(String policyAssignmentId) {
if (policyAssignmentId == null) {
throw new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.");
}
final String apiVersion = "2017-06-01-preview";
return service.deleteById(policyAssignmentId, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PolicyAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<PolicyAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PolicyAssignmentInner> clientResponse = deleteByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PolicyAssignmentInner> deleteByIdDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PolicyAssignmentInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PolicyAssignmentInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Creates a policy assignment by ID.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
- parameters – Parameters for policy assignment.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PolicyAssignmentInner object if successful.
/**
* Creates a policy assignment by ID.
* Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @param parameters Parameters for 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 createById(String policyAssignmentId, PolicyAssignmentInner parameters) {
return createByIdWithServiceResponseAsync(policyAssignmentId, parameters).toBlocking().single().body();
}
Creates a policy assignment by ID.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
- parameters – Parameters for policy assignment.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates a policy assignment by ID.
* Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @param parameters Parameters for policy assignment.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<PolicyAssignmentInner> createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters, final ServiceCallback<PolicyAssignmentInner> serviceCallback) {
return ServiceFuture.fromResponse(createByIdWithServiceResponseAsync(policyAssignmentId, parameters), serviceCallback);
}
Creates a policy assignment by ID.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
- parameters – Parameters for policy assignment.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Creates a policy assignment by ID.
* Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @param parameters Parameters for policy assignment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PolicyAssignmentInner object
*/
public Observable<PolicyAssignmentInner> createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters) {
return createByIdWithServiceResponseAsync(policyAssignmentId, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Override
public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) {
return response.body();
}
});
}
Creates a policy assignment by ID.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
- parameters – Parameters for policy assignment.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Creates a policy assignment by ID.
* Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @param parameters Parameters for policy assignment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PolicyAssignmentInner object
*/
public Observable<ServiceResponse<PolicyAssignmentInner>> createByIdWithServiceResponseAsync(String policyAssignmentId, PolicyAssignmentInner parameters) {
if (policyAssignmentId == null) {
throw new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
final String apiVersion = "2017-06-01-preview";
return service.createById(policyAssignmentId, parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PolicyAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<PolicyAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PolicyAssignmentInner> clientResponse = createByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PolicyAssignmentInner> createByIdDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PolicyAssignmentInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(201, new TypeToken<PolicyAssignmentInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets a policy assignment by ID.
When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PolicyAssignmentInner object if successful.
/**
* Gets a policy assignment by ID.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @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 getById(String policyAssignmentId) {
return getByIdWithServiceResponseAsync(policyAssignmentId).toBlocking().single().body();
}
Gets a policy assignment by ID.
When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a policy assignment by ID.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @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> getByIdAsync(String policyAssignmentId, final ServiceCallback<PolicyAssignmentInner> serviceCallback) {
return ServiceFuture.fromResponse(getByIdWithServiceResponseAsync(policyAssignmentId), serviceCallback);
}
Gets a policy assignment by ID.
When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Gets a policy assignment by ID.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PolicyAssignmentInner object
*/
public Observable<PolicyAssignmentInner> getByIdAsync(String policyAssignmentId) {
return getByIdWithServiceResponseAsync(policyAssignmentId).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Override
public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) {
return response.body();
}
});
}
Gets a policy assignment by ID.
When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
Params: - policyAssignmentId – The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PolicyAssignmentInner object
/**
* Gets a policy assignment by ID.
* When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.
*
* @param policyAssignmentId The ID of the policy assignment to get. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PolicyAssignmentInner object
*/
public Observable<ServiceResponse<PolicyAssignmentInner>> getByIdWithServiceResponseAsync(String policyAssignmentId) {
if (policyAssignmentId == null) {
throw new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.");
}
final String apiVersion = "2017-06-01-preview";
return service.getById(policyAssignmentId, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PolicyAssignmentInner>>>() {
@Override
public Observable<ServiceResponse<PolicyAssignmentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PolicyAssignmentInner> clientResponse = getByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PolicyAssignmentInner> getByIdDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PolicyAssignmentInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PolicyAssignmentInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets policy assignments for the resource group.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets policy assignments for the resource group.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @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<PolicyAssignmentInner> listByResourceGroupNext(final String nextPageLink) {
ServiceResponse<Page<PolicyAssignmentInner>> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets policy assignments for the resource group.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets policy assignments for the resource group.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<PolicyAssignmentInner>> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture<List<PolicyAssignmentInner>> serviceFuture, final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByResourceGroupNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets policy assignments for the resource group.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for the resource group.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<Page<PolicyAssignmentInner>> listByResourceGroupNextAsync(final String nextPageLink) {
return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets policy assignments for the resource group.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for the resource group.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets policy assignments for the resource group.
ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets policy assignments for the resource group.
*
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listByResourceGroupNextDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<PolicyAssignmentInner>> listByResourceGroupNextDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<PolicyAssignmentInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<PolicyAssignmentInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets policy assignments for a resource.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets policy assignments for a resource.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @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<PolicyAssignmentInner> listForResourceNext(final String nextPageLink) {
ServiceResponse<Page<PolicyAssignmentInner>> response = listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listForResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets policy assignments for a resource.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets policy assignments for a resource.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<PolicyAssignmentInner>> listForResourceNextAsync(final String nextPageLink, final ServiceFuture<List<PolicyAssignmentInner>> serviceFuture, final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listForResourceNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listForResourceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets policy assignments for a resource.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for a resource.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<Page<PolicyAssignmentInner>> listForResourceNextAsync(final String nextPageLink) {
return listForResourceNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets policy assignments for a resource.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets policy assignments for a resource.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listForResourceNextWithServiceResponseAsync(final String nextPageLink) {
return listForResourceNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets policy assignments for a resource.
ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets policy assignments for a resource.
*
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listForResourceNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listForResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listForResourceNextDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<PolicyAssignmentInner>> listForResourceNextDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<PolicyAssignmentInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<PolicyAssignmentInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Gets all the policy assignments for a subscription.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- ErrorResponseException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<PolicyAssignmentInner> object if successful.
/**
* Gets all the policy assignments for a subscription.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @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<PolicyAssignmentInner> listNext(final String nextPageLink) {
ServiceResponse<Page<PolicyAssignmentInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<PolicyAssignmentInner>(response.body()) {
@Override
public Page<PolicyAssignmentInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all the policy assignments for a subscription.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all the policy assignments for a subscription.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<PolicyAssignmentInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<PolicyAssignmentInner>> serviceFuture, final ListOperationCallback<PolicyAssignmentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all the policy assignments for a subscription.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets all the policy assignments for a subscription.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<Page<PolicyAssignmentInner>> listNextAsync(final String nextPageLink) {
return listNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
public Page<PolicyAssignmentInner> call(ServiceResponse<Page<PolicyAssignmentInner>> response) {
return response.body();
}
});
}
Gets all the policy assignments for a subscription.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<PolicyAssignmentInner> object
/**
* Gets all the policy assignments for a subscription.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PolicyAssignmentInner> object
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listNextWithServiceResponseAsync(final String nextPageLink) {
return listNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(ServiceResponse<Page<PolicyAssignmentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets all the policy assignments for a subscription.
ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<PolicyAssignmentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all the policy assignments for a subscription.
*
ServiceResponse<PageImpl<PolicyAssignmentInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PolicyAssignmentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyAssignmentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<PolicyAssignmentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<PolicyAssignmentInner>> result = listNextDelegate(response);
return Observable.just(new ServiceResponse<Page<PolicyAssignmentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<PolicyAssignmentInner>> listNextDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<PolicyAssignmentInner>, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<PolicyAssignmentInner>>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
}