/** * 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); } } }); }
/** * Initializes an instance of PolicyClient client. * * @param restClient the REST client to connect to Azure. */ public PolicyClientImpl(RestClient restClient) { super(restClient); initialize(); }
/** * @return the policy assignment management API entry point */ public PolicyAssignments policyAssignments() { if (policyAssignments == null) { policyAssignments = new PolicyAssignmentsImpl(policyClient.policyAssignments()); } return policyAssignments; }
/** * Gets all the built in policy set definitions. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicySetDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> listBuiltInSinglePageAsync() { final String apiVersion = "2017-06-01-preview"; return service.listBuiltIn(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicySetDefinitionInner>>>>() { @Override public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<PolicySetDefinitionInner>> result = listBuiltInDelegate(response); return Observable.just(new ServiceResponse<Page<PolicySetDefinitionInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
private ServiceResponse<PageImpl<PolicySetDefinitionInner>> listDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<PolicySetDefinitionInner>, ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<PolicySetDefinitionInner>>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); }
private ResourceManager(RestClient restClient, String subscriptionId) { super(null, subscriptionId); super.setResourceManager(this); this.resourceManagementClient = new ResourceManagementClientImpl(restClient); this.resourceManagementClient.withSubscriptionId(subscriptionId); this.featureClient = new FeatureClientImpl(restClient); this.featureClient.withSubscriptionId(subscriptionId); this.policyClient = new PolicyClientImpl(restClient); this.policyClient.withSubscriptionId(subscriptionId); }
/** * @return the policy definition management API entry point */ public PolicyDefinitions policyDefinitions() { if (policyDefinitions == null) { policyDefinitions = new PolicyDefinitionsImpl(policyClient.policyDefinitions()); } return policyDefinitions; }
private ServiceResponse<PolicyDefinitionInner> getAtManagementGroupDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PolicyDefinitionInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PolicyDefinitionInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
/** * Gets all the built in policy definitions. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> listBuiltInSinglePageAsync() { final String apiVersion = "2016-12-01"; return service.listBuiltIn(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyDefinitionInner>>>>() { @Override public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<PolicyDefinitionInner>> result = listBuiltInDelegate(response); return Observable.just(new ServiceResponse<Page<PolicyDefinitionInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
private ResourceManager(RestClient restClient, String subscriptionId) { super(null, subscriptionId); super.setResourceManager(this); this.resourceManagementClient = new ResourceManagementClientImpl(restClient); this.resourceManagementClient.withSubscriptionId(subscriptionId); this.featureClient = new FeatureClientImpl(restClient); this.featureClient.withSubscriptionId(subscriptionId); this.policyClient = new PolicyClientImpl(restClient); this.policyClient.withSubscriptionId(subscriptionId); }
/** * @return the policy definition management API entry point */ public PolicyDefinitions policyDefinitions() { if (policyDefinitions == null) { policyDefinitions = new PolicyDefinitionsImpl(policyClient.policyDefinitions()); } return policyDefinitions; }
/** * Gets all the policy set definitions for a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicySetDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> 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"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicySetDefinitionInner>>>>() { @Override public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<PolicySetDefinitionInner>> result = listDelegate(response); return Observable.just(new ServiceResponse<Page<PolicySetDefinitionInner>>(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); }
/** * Gets all the built in policy definitions. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> listBuiltInSinglePageAsync() { final String apiVersion = "2016-12-01"; return service.listBuiltIn(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyDefinitionInner>>>>() { @Override public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<PolicyDefinitionInner>> result = listBuiltInDelegate(response); return Observable.just(new ServiceResponse<Page<PolicyDefinitionInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
/** * Initializes an instance of PolicyClient client. * * @param baseUrl the base URL of the host * @param credentials the management credentials for Azure */ public PolicyClientImpl(String baseUrl, ServiceClientCredentials credentials) { super(baseUrl, credentials); initialize(); }
/** * @return the policy assignment management API entry point */ public PolicyAssignments policyAssignments() { if (policyAssignments == null) { policyAssignments = new PolicyAssignmentsImpl(policyClient.policyAssignments()); } return policyAssignments; }
/** * Gets all the policy definitions for a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicyDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2016-12-01"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicyDefinitionInner>>>>() { @Override public Observable<ServiceResponse<Page<PolicyDefinitionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<PolicyDefinitionInner>> result = listDelegate(response); return Observable.just(new ServiceResponse<Page<PolicyDefinitionInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
private ServiceResponse<PolicySetDefinitionInner> getAtManagementGroupDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PolicySetDefinitionInner, ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PolicySetDefinitionInner>() { }.getType()) .registerError(ErrorResponseException.class) .build(response); }
/** * Gets all the built in policy set definitions. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PolicySetDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> listBuiltInSinglePageAsync() { final String apiVersion = "2017-06-01-preview"; return service.listBuiltIn(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<PolicySetDefinitionInner>>>>() { @Override public Observable<ServiceResponse<Page<PolicySetDefinitionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<PolicySetDefinitionInner>> result = listBuiltInDelegate(response); return Observable.just(new ServiceResponse<Page<PolicySetDefinitionInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
/** * Initializes an instance of PolicyClient client. * * @param baseUrl the base URL of the host * @param credentials the management credentials for Azure */ public PolicyClientImpl(String baseUrl, ServiceClientCredentials credentials) { super(baseUrl, credentials); initialize(); }