/** * 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.appservice.implementation; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; 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.CloudException; import com.microsoft.azure.ListOperationCallback; 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.PATCH; import retrofit2.http.Path; import retrofit2.http.POST; 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 Domains. */ public class DomainsInner implements InnerSupportsGet<DomainInner>, InnerSupportsDelete<Void>, InnerSupportsListing<DomainInner> { /** The Retrofit service to perform REST calls. */ private DomainsService service; /** The service client containing this operation class. */ private WebSiteManagementClientImpl client; /** * Initializes an instance of DomainsInner. * * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */ public DomainsInner(Retrofit retrofit, WebSiteManagementClientImpl client) { this.service = retrofit.create(DomainsService.class); this.client = client; } /** * The interface defining all the services for Domains to be * used by Retrofit to perform actually REST calls. */ interface DomainsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains checkAvailability" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability") Observable<Response<ResponseBody>> checkAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body NameIdentifierInner identifier, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains") Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains getControlCenterSsoRequest" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest") Observable<Response<ResponseBody>> getControlCenterSsoRequest(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains listRecommendations" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations") Observable<Response<ResponseBody>> listRecommendations(@Path("subscriptionId") String subscriptionId, @Body DomainRecommendationSearchParametersInner 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.appservice.Domains listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains") Observable<Response<ResponseBody>> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}") Observable<Response<ResponseBody>> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}") Observable<Response<ResponseBody>> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("subscriptionId") String subscriptionId, @Body DomainInner domain, @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.appservice.Domains beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}") Observable<Response<ResponseBody>> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("subscriptionId") String subscriptionId, @Body DomainInner domain, @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.appservice.Domains delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("subscriptionId") String subscriptionId, @Query("forceHardDeleteDomain") Boolean forceHardDeleteDomain, @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.appservice.Domains listOwnershipIdentifiers" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers") Observable<Response<ResponseBody>> listOwnershipIdentifiers(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains getOwnershipIdentifier" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}") Observable<Response<ResponseBody>> getOwnershipIdentifier(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains createOrUpdateOwnershipIdentifier" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}") Observable<Response<ResponseBody>> createOrUpdateOwnershipIdentifier(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DomainOwnershipIdentifierInner domainOwnershipIdentifier, @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.appservice.Domains deleteOwnershipIdentifier" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> deleteOwnershipIdentifier(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains updateOwnershipIdentifier" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}") Observable<Response<ResponseBody>> updateOwnershipIdentifier(@Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body DomainOwnershipIdentifierInner domainOwnershipIdentifier, @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.appservice.Domains listNext" }) @GET Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Domains listRecommendationsNext" }) @GET Observable<Response<ResponseBody>> listRecommendationsNext(@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.appservice.Domains 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.appservice.Domains listOwnershipIdentifiersNext" }) @GET Observable<Response<ResponseBody>> listOwnershipIdentifiersNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } /** * Check if a domain is available for registration. * Check if a domain is available for registration. * * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainAvailablilityCheckResultInner object if successful. */ public DomainAvailablilityCheckResultInner checkAvailability() { return checkAvailabilityWithServiceResponseAsync().toBlocking().single().body(); } /** * Check if a domain is available for registration. * Check if a domain is available for registration. * * @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<DomainAvailablilityCheckResultInner> checkAvailabilityAsync(final ServiceCallback<DomainAvailablilityCheckResultInner> serviceCallback) { return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(), serviceCallback); } /** * Check if a domain is available for registration. * Check if a domain is available for registration. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainAvailablilityCheckResultInner object */ public Observable<DomainAvailablilityCheckResultInner> checkAvailabilityAsync() { return checkAvailabilityWithServiceResponseAsync().map(new Func1<ServiceResponse<DomainAvailablilityCheckResultInner>, DomainAvailablilityCheckResultInner>() { @Override public DomainAvailablilityCheckResultInner call(ServiceResponse<DomainAvailablilityCheckResultInner> response) { return response.body(); } }); } /** * Check if a domain is available for registration. * Check if a domain is available for registration. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainAvailablilityCheckResultInner object */ public Observable<ServiceResponse<DomainAvailablilityCheckResultInner>> checkAvailabilityWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2015-04-01"; final String name = null; NameIdentifierInner identifier = new NameIdentifierInner(); identifier.withName(null); return service.checkAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), identifier, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DomainAvailablilityCheckResultInner>>>() { @Override public Observable<ServiceResponse<DomainAvailablilityCheckResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DomainAvailablilityCheckResultInner> clientResponse = checkAvailabilityDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } /** * Check if a domain is available for registration. * Check if a domain is available for registration. * * @param name Name of the object. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainAvailablilityCheckResultInner object if successful. */ public DomainAvailablilityCheckResultInner checkAvailability(String name) { return checkAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); } /** * Check if a domain is available for registration. * Check if a domain is available for registration. * * @param name Name of the object. * @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<DomainAvailablilityCheckResultInner> checkAvailabilityAsync(String name, final ServiceCallback<DomainAvailablilityCheckResultInner> serviceCallback) { return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(name), serviceCallback); } /** * Check if a domain is available for registration. * Check if a domain is available for registration. * * @param name Name of the object. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainAvailablilityCheckResultInner object */ public Observable<DomainAvailablilityCheckResultInner> checkAvailabilityAsync(String name) { return checkAvailabilityWithServiceResponseAsync(name).map(new Func1<ServiceResponse<DomainAvailablilityCheckResultInner>, DomainAvailablilityCheckResultInner>() { @Override public DomainAvailablilityCheckResultInner call(ServiceResponse<DomainAvailablilityCheckResultInner> response) { return response.body(); } }); } /** * Check if a domain is available for registration. * Check if a domain is available for registration. * * @param name Name of the object. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainAvailablilityCheckResultInner object */ public Observable<ServiceResponse<DomainAvailablilityCheckResultInner>> checkAvailabilityWithServiceResponseAsync(String name) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2015-04-01"; NameIdentifierInner identifier = new NameIdentifierInner(); identifier.withName(name); return service.checkAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), identifier, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DomainAvailablilityCheckResultInner>>>() { @Override public Observable<ServiceResponse<DomainAvailablilityCheckResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DomainAvailablilityCheckResultInner> clientResponse = checkAvailabilityDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DomainAvailablilityCheckResultInner> checkAvailabilityDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DomainAvailablilityCheckResultInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DomainAvailablilityCheckResultInner>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Get all domains in a subscription. * Get all domains in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<DomainInner> object if successful. */ public PagedList<DomainInner> list() { ServiceResponse<Page<DomainInner>> response = listSinglePageAsync().toBlocking().single(); return new PagedList<DomainInner>(response.body()) { @Override public Page<DomainInner> nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** * Get all domains in a subscription. * Get all domains in 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<DomainInner>> listAsync(final ListOperationCallback<DomainInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listSinglePageAsync(), new Func1<String, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** * Get all domains in a subscription. * Get all domains in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<DomainInner> object */ public Observable<Page<DomainInner>> listAsync() { return listWithServiceResponseAsync() .map(new Func1<ServiceResponse<Page<DomainInner>>, Page<DomainInner>>() { @Override public Page<DomainInner> call(ServiceResponse<Page<DomainInner>> response) { return response.body(); } }); } /** * Get all domains in a subscription. * Get all domains in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<DomainInner> object */ public Observable<ServiceResponse<Page<DomainInner>>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1<ServiceResponse<Page<DomainInner>>, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(ServiceResponse<Page<DomainInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } /** * Get all domains in a subscription. * Get all domains in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<DomainInner>>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2015-04-01"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DomainInner>> result = listDelegate(response); return Observable.just(new ServiceResponse<Page<DomainInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<DomainInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<DomainInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<DomainInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Generate a single sign-on request for the domain management portal. * Generate a single sign-on request for the domain management portal. * * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainControlCenterSsoRequestInner object if successful. */ public DomainControlCenterSsoRequestInner getControlCenterSsoRequest() { return getControlCenterSsoRequestWithServiceResponseAsync().toBlocking().single().body(); } /** * Generate a single sign-on request for the domain management portal. * Generate a single sign-on request for the domain management portal. * * @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<DomainControlCenterSsoRequestInner> getControlCenterSsoRequestAsync(final ServiceCallback<DomainControlCenterSsoRequestInner> serviceCallback) { return ServiceFuture.fromResponse(getControlCenterSsoRequestWithServiceResponseAsync(), serviceCallback); } /** * Generate a single sign-on request for the domain management portal. * Generate a single sign-on request for the domain management portal. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainControlCenterSsoRequestInner object */ public Observable<DomainControlCenterSsoRequestInner> getControlCenterSsoRequestAsync() { return getControlCenterSsoRequestWithServiceResponseAsync().map(new Func1<ServiceResponse<DomainControlCenterSsoRequestInner>, DomainControlCenterSsoRequestInner>() { @Override public DomainControlCenterSsoRequestInner call(ServiceResponse<DomainControlCenterSsoRequestInner> response) { return response.body(); } }); } /** * Generate a single sign-on request for the domain management portal. * Generate a single sign-on request for the domain management portal. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainControlCenterSsoRequestInner object */ public Observable<ServiceResponse<DomainControlCenterSsoRequestInner>> getControlCenterSsoRequestWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2015-04-01"; return service.getControlCenterSsoRequest(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DomainControlCenterSsoRequestInner>>>() { @Override public Observable<ServiceResponse<DomainControlCenterSsoRequestInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DomainControlCenterSsoRequestInner> clientResponse = getControlCenterSsoRequestDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DomainControlCenterSsoRequestInner> getControlCenterSsoRequestDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DomainControlCenterSsoRequestInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DomainControlCenterSsoRequestInner>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * * @param parameters Search parameters for domain name recommendations. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<NameIdentifierInner> object if successful. */ public PagedList<NameIdentifierInner> listRecommendations(final DomainRecommendationSearchParametersInner parameters) { ServiceResponse<Page<NameIdentifierInner>> response = listRecommendationsSinglePageAsync(parameters).toBlocking().single(); return new PagedList<NameIdentifierInner>(response.body()) { @Override public Page<NameIdentifierInner> nextPage(String nextPageLink) { return listRecommendationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * * @param parameters Search parameters for domain name recommendations. * @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<NameIdentifierInner>> listRecommendationsAsync(final DomainRecommendationSearchParametersInner parameters, final ListOperationCallback<NameIdentifierInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listRecommendationsSinglePageAsync(parameters), new Func1<String, Observable<ServiceResponse<Page<NameIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<NameIdentifierInner>>> call(String nextPageLink) { return listRecommendationsNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * * @param parameters Search parameters for domain name recommendations. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<NameIdentifierInner> object */ public Observable<Page<NameIdentifierInner>> listRecommendationsAsync(final DomainRecommendationSearchParametersInner parameters) { return listRecommendationsWithServiceResponseAsync(parameters) .map(new Func1<ServiceResponse<Page<NameIdentifierInner>>, Page<NameIdentifierInner>>() { @Override public Page<NameIdentifierInner> call(ServiceResponse<Page<NameIdentifierInner>> response) { return response.body(); } }); } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * * @param parameters Search parameters for domain name recommendations. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<NameIdentifierInner> object */ public Observable<ServiceResponse<Page<NameIdentifierInner>>> listRecommendationsWithServiceResponseAsync(final DomainRecommendationSearchParametersInner parameters) { return listRecommendationsSinglePageAsync(parameters) .concatMap(new Func1<ServiceResponse<Page<NameIdentifierInner>>, Observable<ServiceResponse<Page<NameIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<NameIdentifierInner>>> call(ServiceResponse<Page<NameIdentifierInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listRecommendationsNextWithServiceResponseAsync(nextPageLink)); } }); } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * ServiceResponse<PageImpl<NameIdentifierInner>> * @param parameters Search parameters for domain name recommendations. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<NameIdentifierInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<NameIdentifierInner>>> listRecommendationsSinglePageAsync(final DomainRecommendationSearchParametersInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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 = "2015-04-01"; return service.listRecommendations(this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<NameIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<NameIdentifierInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<NameIdentifierInner>> result = listRecommendationsDelegate(response); return Observable.just(new ServiceResponse<Page<NameIdentifierInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<NameIdentifierInner>> listRecommendationsDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<NameIdentifierInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<NameIdentifierInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Get all domains in a resource group. * Get all domains in a resource group. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<DomainInner> object if successful. */ public PagedList<DomainInner> listByResourceGroup(final String resourceGroupName) { ServiceResponse<Page<DomainInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); return new PagedList<DomainInner>(response.body()) { @Override public Page<DomainInner> nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** * Get all domains in a resource group. * Get all domains in a resource group. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @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<DomainInner>> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback<DomainInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByResourceGroupSinglePageAsync(resourceGroupName), new Func1<String, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** * Get all domains in a resource group. * Get all domains in a resource group. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<DomainInner> object */ public Observable<Page<DomainInner>> listByResourceGroupAsync(final String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName) .map(new Func1<ServiceResponse<Page<DomainInner>>, Page<DomainInner>>() { @Override public Page<DomainInner> call(ServiceResponse<Page<DomainInner>> response) { return response.body(); } }); } /** * Get all domains in a resource group. * Get all domains in a resource group. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<DomainInner> object */ public Observable<ServiceResponse<Page<DomainInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { return listByResourceGroupSinglePageAsync(resourceGroupName) .concatMap(new Func1<ServiceResponse<Page<DomainInner>>, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(ServiceResponse<Page<DomainInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } /** * Get all domains in a resource group. * Get all domains in a resource group. * ServiceResponse<PageImpl<DomainInner>> * @param resourceGroupName Name of the resource group to which the resource belongs. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<DomainInner>>> 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 = "2015-04-01"; return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DomainInner>> result = listByResourceGroupDelegate(response); return Observable.just(new ServiceResponse<Page<DomainInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<DomainInner>> listByResourceGroupDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<DomainInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<DomainInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Get a domain. * Get a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainInner object if successful. */ public DomainInner getByResourceGroup(String resourceGroupName, String domainName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); } /** * Get a domain. * Get a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @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<DomainInner> getByResourceGroupAsync(String resourceGroupName, String domainName, final ServiceCallback<DomainInner> serviceCallback) { return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); } /** * Get a domain. * Get a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainInner object */ public Observable<DomainInner> getByResourceGroupAsync(String resourceGroupName, String domainName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1<ServiceResponse<DomainInner>, DomainInner>() { @Override public DomainInner call(ServiceResponse<DomainInner> response) { return response.body(); } }); } /** * Get a domain. * Get a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainInner object */ public Observable<ServiceResponse<DomainInner>> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String domainName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName 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 = "2015-04-01"; return service.getByResourceGroup(resourceGroupName, domainName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DomainInner>>>() { @Override public Observable<ServiceResponse<DomainInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DomainInner> clientResponse = getByResourceGroupDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DomainInner> getByResourceGroupDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DomainInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DomainInner>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Creates or updates a domain. * Creates or updates a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param domain Domain registration information. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainInner object if successful. */ public DomainInner createOrUpdate(String resourceGroupName, String domainName, DomainInner domain) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domain).toBlocking().last().body(); } /** * Creates or updates a domain. * Creates or updates a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param domain Domain registration information. * @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<DomainInner> createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domain, final ServiceCallback<DomainInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domain), serviceCallback); } /** * Creates or updates a domain. * Creates or updates a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param domain Domain registration information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ public Observable<DomainInner> createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domain) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domain).map(new Func1<ServiceResponse<DomainInner>, DomainInner>() { @Override public DomainInner call(ServiceResponse<DomainInner> response) { return response.body(); } }); } /** * Creates or updates a domain. * Creates or updates a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param domain Domain registration information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ public Observable<ServiceResponse<DomainInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domain) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (domain == null) { throw new IllegalArgumentException("Parameter domain is required and cannot be null."); } Validator.validate(domain); final String apiVersion = "2015-04-01"; Observable<Response<ResponseBody>> observable = service.createOrUpdate(resourceGroupName, domainName, this.client.subscriptionId(), domain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<DomainInner>() { }.getType()); } /** * Creates or updates a domain. * Creates or updates a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param domain Domain registration information. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainInner object if successful. */ public DomainInner beginCreateOrUpdate(String resourceGroupName, String domainName, DomainInner domain) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domain).toBlocking().single().body(); } /** * Creates or updates a domain. * Creates or updates a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param domain Domain registration information. * @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<DomainInner> beginCreateOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domain, final ServiceCallback<DomainInner> serviceCallback) { return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domain), serviceCallback); } /** * Creates or updates a domain. * Creates or updates a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param domain Domain registration information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainInner object */ public Observable<DomainInner> beginCreateOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domain) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domain).map(new Func1<ServiceResponse<DomainInner>, DomainInner>() { @Override public DomainInner call(ServiceResponse<DomainInner> response) { return response.body(); } }); } /** * Creates or updates a domain. * Creates or updates a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param domain Domain registration information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainInner object */ public Observable<ServiceResponse<DomainInner>> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domain) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (domain == null) { throw new IllegalArgumentException("Parameter domain is required and cannot be null."); } Validator.validate(domain); final String apiVersion = "2015-04-01"; return service.beginCreateOrUpdate(resourceGroupName, domainName, this.client.subscriptionId(), domain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DomainInner>>>() { @Override public Observable<ServiceResponse<DomainInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DomainInner> clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DomainInner> beginCreateOrUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DomainInner, CloudException>newInstance(this.client.serializerAdapter()) .register(202, new TypeToken<DomainInner>() { }.getType()) .register(200, new TypeToken<DomainInner>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Delete a domain. * Delete a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void delete(String resourceGroupName, String domainName) { deleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); } /** * Delete a domain. * Delete a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @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<Void> deleteAsync(String resourceGroupName, String domainName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); } /** * Delete a domain. * Delete a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ public Observable<Void> deleteAsync(String resourceGroupName, String domainName) { return deleteWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); } /** * Delete a domain. * Delete a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String domainName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName 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 = "2015-04-01"; final Boolean forceHardDeleteDomain = null; return service.delete(resourceGroupName, domainName, this.client.subscriptionId(), forceHardDeleteDomain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = deleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } /** * Delete a domain. * Delete a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void delete(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) { deleteWithServiceResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain).toBlocking().single().body(); } /** * Delete a domain. * Delete a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. * @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<Void> deleteAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain), serviceCallback); } /** * Delete a domain. * Delete a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ public Observable<Void> deleteAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) { return deleteWithServiceResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); } /** * Delete a domain. * Delete a domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of the domain. * @param forceHardDeleteDomain Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName 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 = "2015-04-01"; return service.delete(resourceGroupName, domainName, this.client.subscriptionId(), forceHardDeleteDomain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = deleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> deleteDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<DomainOwnershipIdentifierInner> object if successful. */ public PagedList<DomainOwnershipIdentifierInner> listOwnershipIdentifiers(final String resourceGroupName, final String domainName) { ServiceResponse<Page<DomainOwnershipIdentifierInner>> response = listOwnershipIdentifiersSinglePageAsync(resourceGroupName, domainName).toBlocking().single(); return new PagedList<DomainOwnershipIdentifierInner>(response.body()) { @Override public Page<DomainOwnershipIdentifierInner> nextPage(String nextPageLink) { return listOwnershipIdentifiersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @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<DomainOwnershipIdentifierInner>> listOwnershipIdentifiersAsync(final String resourceGroupName, final String domainName, final ListOperationCallback<DomainOwnershipIdentifierInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listOwnershipIdentifiersSinglePageAsync(resourceGroupName, domainName), new Func1<String, Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> call(String nextPageLink) { return listOwnershipIdentifiersNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<DomainOwnershipIdentifierInner> object */ public Observable<Page<DomainOwnershipIdentifierInner>> listOwnershipIdentifiersAsync(final String resourceGroupName, final String domainName) { return listOwnershipIdentifiersWithServiceResponseAsync(resourceGroupName, domainName) .map(new Func1<ServiceResponse<Page<DomainOwnershipIdentifierInner>>, Page<DomainOwnershipIdentifierInner>>() { @Override public Page<DomainOwnershipIdentifierInner> call(ServiceResponse<Page<DomainOwnershipIdentifierInner>> response) { return response.body(); } }); } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<DomainOwnershipIdentifierInner> object */ public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> listOwnershipIdentifiersWithServiceResponseAsync(final String resourceGroupName, final String domainName) { return listOwnershipIdentifiersSinglePageAsync(resourceGroupName, domainName) .concatMap(new Func1<ServiceResponse<Page<DomainOwnershipIdentifierInner>>, Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> call(ServiceResponse<Page<DomainOwnershipIdentifierInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listOwnershipIdentifiersNextWithServiceResponseAsync(nextPageLink)); } }); } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * ServiceResponse<PageImpl<DomainOwnershipIdentifierInner>> * @param resourceGroupName Name of the resource group to which the resource belongs. ServiceResponse<PageImpl<DomainOwnershipIdentifierInner>> * @param domainName Name of domain. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<DomainOwnershipIdentifierInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> listOwnershipIdentifiersSinglePageAsync(final String resourceGroupName, final String domainName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName 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 = "2015-04-01"; return service.listOwnershipIdentifiers(resourceGroupName, domainName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DomainOwnershipIdentifierInner>> result = listOwnershipIdentifiersDelegate(response); return Observable.just(new ServiceResponse<Page<DomainOwnershipIdentifierInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<DomainOwnershipIdentifierInner>> listOwnershipIdentifiersDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<DomainOwnershipIdentifierInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<DomainOwnershipIdentifierInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Get ownership identifier for domain. * Get ownership identifier for domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainOwnershipIdentifierInner object if successful. */ public DomainOwnershipIdentifierInner getOwnershipIdentifier(String resourceGroupName, String domainName, String name) { return getOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name).toBlocking().single().body(); } /** * Get ownership identifier for domain. * Get ownership identifier for domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @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<DomainOwnershipIdentifierInner> getOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, final ServiceCallback<DomainOwnershipIdentifierInner> serviceCallback) { return ServiceFuture.fromResponse(getOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name), serviceCallback); } /** * Get ownership identifier for domain. * Get ownership identifier for domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainOwnershipIdentifierInner object */ public Observable<DomainOwnershipIdentifierInner> getOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name) { return getOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name).map(new Func1<ServiceResponse<DomainOwnershipIdentifierInner>, DomainOwnershipIdentifierInner>() { @Override public DomainOwnershipIdentifierInner call(ServiceResponse<DomainOwnershipIdentifierInner> response) { return response.body(); } }); } /** * Get ownership identifier for domain. * Get ownership identifier for domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainOwnershipIdentifierInner object */ public Observable<ServiceResponse<DomainOwnershipIdentifierInner>> getOwnershipIdentifierWithServiceResponseAsync(String resourceGroupName, String domainName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name 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 = "2015-04-01"; return service.getOwnershipIdentifier(resourceGroupName, domainName, name, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DomainOwnershipIdentifierInner>>>() { @Override public Observable<ServiceResponse<DomainOwnershipIdentifierInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DomainOwnershipIdentifierInner> clientResponse = getOwnershipIdentifierDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DomainOwnershipIdentifierInner> getOwnershipIdentifierDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DomainOwnershipIdentifierInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DomainOwnershipIdentifierInner>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainOwnershipIdentifierInner object if successful. */ public DomainOwnershipIdentifierInner createOrUpdateOwnershipIdentifier(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) { return createOrUpdateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier).toBlocking().single().body(); } /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ public ServiceFuture<DomainOwnershipIdentifierInner> createOrUpdateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier, final ServiceCallback<DomainOwnershipIdentifierInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier), serviceCallback); } /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainOwnershipIdentifierInner object */ public Observable<DomainOwnershipIdentifierInner> createOrUpdateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) { return createOrUpdateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier).map(new Func1<ServiceResponse<DomainOwnershipIdentifierInner>, DomainOwnershipIdentifierInner>() { @Override public DomainOwnershipIdentifierInner call(ServiceResponse<DomainOwnershipIdentifierInner> response) { return response.body(); } }); } /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainOwnershipIdentifierInner object */ public Observable<ServiceResponse<DomainOwnershipIdentifierInner>> createOrUpdateOwnershipIdentifierWithServiceResponseAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (domainOwnershipIdentifier == null) { throw new IllegalArgumentException("Parameter domainOwnershipIdentifier is required and cannot be null."); } Validator.validate(domainOwnershipIdentifier); final String apiVersion = "2015-04-01"; return service.createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, this.client.subscriptionId(), domainOwnershipIdentifier, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DomainOwnershipIdentifierInner>>>() { @Override public Observable<ServiceResponse<DomainOwnershipIdentifierInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DomainOwnershipIdentifierInner> clientResponse = createOrUpdateOwnershipIdentifierDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DomainOwnershipIdentifierInner> createOrUpdateOwnershipIdentifierDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DomainOwnershipIdentifierInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DomainOwnershipIdentifierInner>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Delete ownership identifier for domain. * Delete ownership identifier for domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void deleteOwnershipIdentifier(String resourceGroupName, String domainName, String name) { deleteOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name).toBlocking().single().body(); } /** * Delete ownership identifier for domain. * Delete ownership identifier for domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @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<Void> deleteOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name), serviceCallback); } /** * Delete ownership identifier for domain. * Delete ownership identifier for domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ public Observable<Void> deleteOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name) { return deleteOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); } /** * Delete ownership identifier for domain. * Delete ownership identifier for domain. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ public Observable<ServiceResponse<Void>> deleteOwnershipIdentifierWithServiceResponseAsync(String resourceGroupName, String domainName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name 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 = "2015-04-01"; return service.deleteOwnershipIdentifier(resourceGroupName, domainName, name, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = deleteOwnershipIdentifierDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> deleteOwnershipIdentifierDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainOwnershipIdentifierInner object if successful. */ public DomainOwnershipIdentifierInner updateOwnershipIdentifier(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) { return updateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier).toBlocking().single().body(); } /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ public ServiceFuture<DomainOwnershipIdentifierInner> updateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier, final ServiceCallback<DomainOwnershipIdentifierInner> serviceCallback) { return ServiceFuture.fromResponse(updateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier), serviceCallback); } /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainOwnershipIdentifierInner object */ public Observable<DomainOwnershipIdentifierInner> updateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) { return updateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier).map(new Func1<ServiceResponse<DomainOwnershipIdentifierInner>, DomainOwnershipIdentifierInner>() { @Override public DomainOwnershipIdentifierInner call(ServiceResponse<DomainOwnershipIdentifierInner> response) { return response.body(); } }); } /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainOwnershipIdentifierInner object */ public Observable<ServiceResponse<DomainOwnershipIdentifierInner>> updateOwnershipIdentifierWithServiceResponseAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (domainOwnershipIdentifier == null) { throw new IllegalArgumentException("Parameter domainOwnershipIdentifier is required and cannot be null."); } Validator.validate(domainOwnershipIdentifier); final String apiVersion = "2015-04-01"; return service.updateOwnershipIdentifier(resourceGroupName, domainName, name, this.client.subscriptionId(), domainOwnershipIdentifier, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DomainOwnershipIdentifierInner>>>() { @Override public Observable<ServiceResponse<DomainOwnershipIdentifierInner>> call(Response<ResponseBody> response) { try { ServiceResponse<DomainOwnershipIdentifierInner> clientResponse = updateOwnershipIdentifierDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<DomainOwnershipIdentifierInner> updateOwnershipIdentifierDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<DomainOwnershipIdentifierInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<DomainOwnershipIdentifierInner>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Get all domains in a subscription. * Get all domains in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<DomainInner> object if successful. */ public PagedList<DomainInner> listNext(final String nextPageLink) { ServiceResponse<Page<DomainInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<DomainInner>(response.body()) { @Override public Page<DomainInner> nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** * Get all domains in a subscription. * Get all domains in 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<DomainInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<DomainInner>> serviceFuture, final ListOperationCallback<DomainInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** * Get all domains in a subscription. * Get all domains in 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<DomainInner> object */ public Observable<Page<DomainInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<DomainInner>>, Page<DomainInner>>() { @Override public Page<DomainInner> call(ServiceResponse<Page<DomainInner>> response) { return response.body(); } }); } /** * Get all domains in a subscription. * Get all domains in 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<DomainInner> object */ public Observable<ServiceResponse<Page<DomainInner>>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<DomainInner>>, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(ServiceResponse<Page<DomainInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } /** * Get all domains in a subscription. * Get all domains in a subscription. * ServiceResponse<PageImpl<DomainInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<DomainInner>>> 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<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DomainInner>> result = listNextDelegate(response); return Observable.just(new ServiceResponse<Page<DomainInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<DomainInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<DomainInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<DomainInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<NameIdentifierInner> object if successful. */ public PagedList<NameIdentifierInner> listRecommendationsNext(final String nextPageLink) { ServiceResponse<Page<NameIdentifierInner>> response = listRecommendationsNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<NameIdentifierInner>(response.body()) { @Override public Page<NameIdentifierInner> nextPage(String nextPageLink) { return listRecommendationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * * @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<NameIdentifierInner>> listRecommendationsNextAsync(final String nextPageLink, final ServiceFuture<List<NameIdentifierInner>> serviceFuture, final ListOperationCallback<NameIdentifierInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listRecommendationsNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<NameIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<NameIdentifierInner>>> call(String nextPageLink) { return listRecommendationsNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * * @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<NameIdentifierInner> object */ public Observable<Page<NameIdentifierInner>> listRecommendationsNextAsync(final String nextPageLink) { return listRecommendationsNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<NameIdentifierInner>>, Page<NameIdentifierInner>>() { @Override public Page<NameIdentifierInner> call(ServiceResponse<Page<NameIdentifierInner>> response) { return response.body(); } }); } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * * @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<NameIdentifierInner> object */ public Observable<ServiceResponse<Page<NameIdentifierInner>>> listRecommendationsNextWithServiceResponseAsync(final String nextPageLink) { return listRecommendationsNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<NameIdentifierInner>>, Observable<ServiceResponse<Page<NameIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<NameIdentifierInner>>> call(ServiceResponse<Page<NameIdentifierInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listRecommendationsNextWithServiceResponseAsync(nextPageLink)); } }); } /** * Get domain name recommendations based on keywords. * Get domain name recommendations based on keywords. * ServiceResponse<PageImpl<NameIdentifierInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<NameIdentifierInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<NameIdentifierInner>>> listRecommendationsNextSinglePageAsync(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.listRecommendationsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<NameIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<NameIdentifierInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<NameIdentifierInner>> result = listRecommendationsNextDelegate(response); return Observable.just(new ServiceResponse<Page<NameIdentifierInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<NameIdentifierInner>> listRecommendationsNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<NameIdentifierInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<NameIdentifierInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Get all domains in a resource group. * Get all domains in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<DomainInner> object if successful. */ public PagedList<DomainInner> listByResourceGroupNext(final String nextPageLink) { ServiceResponse<Page<DomainInner>> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<DomainInner>(response.body()) { @Override public Page<DomainInner> nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** * Get all domains in a resource group. * Get all domains in a 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<DomainInner>> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture<List<DomainInner>> serviceFuture, final ListOperationCallback<DomainInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByResourceGroupNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** * Get all domains in a resource group. * Get all domains in a 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<DomainInner> object */ public Observable<Page<DomainInner>> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<DomainInner>>, Page<DomainInner>>() { @Override public Page<DomainInner> call(ServiceResponse<Page<DomainInner>> response) { return response.body(); } }); } /** * Get all domains in a resource group. * Get all domains in a 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<DomainInner> object */ public Observable<ServiceResponse<Page<DomainInner>>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<DomainInner>>, Observable<ServiceResponse<Page<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(ServiceResponse<Page<DomainInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } /** * Get all domains in a resource group. * Get all domains in a resource group. * ServiceResponse<PageImpl<DomainInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<DomainInner>>> 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<DomainInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DomainInner>> result = listByResourceGroupNextDelegate(response); return Observable.just(new ServiceResponse<Page<DomainInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<DomainInner>> listByResourceGroupNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<DomainInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<DomainInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<DomainOwnershipIdentifierInner> object if successful. */ public PagedList<DomainOwnershipIdentifierInner> listOwnershipIdentifiersNext(final String nextPageLink) { ServiceResponse<Page<DomainOwnershipIdentifierInner>> response = listOwnershipIdentifiersNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<DomainOwnershipIdentifierInner>(response.body()) { @Override public Page<DomainOwnershipIdentifierInner> nextPage(String nextPageLink) { return listOwnershipIdentifiersNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * * @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<DomainOwnershipIdentifierInner>> listOwnershipIdentifiersNextAsync(final String nextPageLink, final ServiceFuture<List<DomainOwnershipIdentifierInner>> serviceFuture, final ListOperationCallback<DomainOwnershipIdentifierInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listOwnershipIdentifiersNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> call(String nextPageLink) { return listOwnershipIdentifiersNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * * @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<DomainOwnershipIdentifierInner> object */ public Observable<Page<DomainOwnershipIdentifierInner>> listOwnershipIdentifiersNextAsync(final String nextPageLink) { return listOwnershipIdentifiersNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<DomainOwnershipIdentifierInner>>, Page<DomainOwnershipIdentifierInner>>() { @Override public Page<DomainOwnershipIdentifierInner> call(ServiceResponse<Page<DomainOwnershipIdentifierInner>> response) { return response.body(); } }); } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * * @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<DomainOwnershipIdentifierInner> object */ public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> listOwnershipIdentifiersNextWithServiceResponseAsync(final String nextPageLink) { return listOwnershipIdentifiersNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<DomainOwnershipIdentifierInner>>, Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> call(ServiceResponse<Page<DomainOwnershipIdentifierInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listOwnershipIdentifiersNextWithServiceResponseAsync(nextPageLink)); } }); } /** * Lists domain ownership identifiers. * Lists domain ownership identifiers. * ServiceResponse<PageImpl<DomainOwnershipIdentifierInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<DomainOwnershipIdentifierInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> listOwnershipIdentifiersNextSinglePageAsync(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.listOwnershipIdentifiersNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>>>() { @Override public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DomainOwnershipIdentifierInner>> result = listOwnershipIdentifiersNextDelegate(response); return Observable.just(new ServiceResponse<Page<DomainOwnershipIdentifierInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<DomainOwnershipIdentifierInner>> listOwnershipIdentifiersNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<DomainOwnershipIdentifierInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<DomainOwnershipIdentifierInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } }