Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information. Code generated by Microsoft (R) AutoRest Code Generator.
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */
package com.microsoft.azure.management.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.ListOperationCallback; import com.microsoft.azure.management.appservice.CertificatePatchResource; import com.microsoft.azure.management.appservice.DefaultErrorResponseException; 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.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 Certificates.
/** * An instance of this class provides access to all the operations defined * in Certificates. */
public class CertificatesInner implements InnerSupportsGet<CertificateInner>, InnerSupportsDelete<Void>, InnerSupportsListing<CertificateInner> {
The Retrofit service to perform REST calls.
/** The Retrofit service to perform REST calls. */
private CertificatesService service;
The service client containing this operation class.
/** The service client containing this operation class. */
private WebSiteManagementClientImpl client;
Initializes an instance of CertificatesInner.
Params:
  • retrofit – the Retrofit instance built from a Retrofit Builder.
  • client – the instance of the service client containing this operation class.
/** * Initializes an instance of CertificatesInner. * * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */
public CertificatesInner(Retrofit retrofit, WebSiteManagementClientImpl client) { this.service = retrofit.create(CertificatesService.class); this.client = client; }
The interface defining all the services for Certificates to be used by Retrofit to perform actually REST calls.
/** * The interface defining all the services for Certificates to be * used by Retrofit to perform actually REST calls. */
interface CertificatesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.Certificates list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates") 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.Certificates listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates") 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.Certificates getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}") Observable<Response<ResponseBody>> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.Certificates createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}") Observable<Response<ResponseBody>> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body CertificateInner certificateEnvelope, @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.Certificates delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @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.Certificates update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}") Observable<Response<ResponseBody>> update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body CertificatePatchResource certificateEnvelope, @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.Certificates 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.Certificates listByResourceGroupNext" }) @GET Observable<Response<ResponseBody>> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Throws:
  • IllegalArgumentException – thrown if parameters fail the validation
  • DefaultErrorResponseException – thrown if the request is rejected by server
  • RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns:the PagedList<CertificateInner> object if successful.
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @throws DefaultErrorResponseException 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&lt;CertificateInner&gt; object if successful. */
public PagedList<CertificateInner> list() { ServiceResponse<Page<CertificateInner>> response = listSinglePageAsync().toBlocking().single(); return new PagedList<CertificateInner>(response.body()) { @Override public Page<CertificateInner> nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Params:
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
public ServiceFuture<List<CertificateInner>> listAsync(final ListOperationCallback<CertificateInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listSinglePageAsync(), new Func1<String, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Throws:
  • IllegalArgumentException – thrown if parameters fail the validation
Returns:the observable to the PagedList<CertificateInner> object
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;CertificateInner&gt; object */
public Observable<Page<CertificateInner>> listAsync() { return listWithServiceResponseAsync() .map(new Func1<ServiceResponse<Page<CertificateInner>>, Page<CertificateInner>>() { @Override public Page<CertificateInner> call(ServiceResponse<Page<CertificateInner>> response) { return response.body(); } }); }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Throws:
  • IllegalArgumentException – thrown if parameters fail the validation
Returns:the observable to the PagedList<CertificateInner> object
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;CertificateInner&gt; object */
public Observable<ServiceResponse<Page<CertificateInner>>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1<ServiceResponse<Page<CertificateInner>>, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(ServiceResponse<Page<CertificateInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Throws:
  • IllegalArgumentException – thrown if parameters fail the validation
Returns:the PagedList<CertificateInner> object wrapped in ServiceResponse if successful.
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;CertificateInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<CertificateInner>>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<CertificateInner>> result = listDelegate(response); return Observable.just(new ServiceResponse<Page<CertificateInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<CertificateInner>> listDelegate(Response<ResponseBody> response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<CertificateInner>, DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<CertificateInner>>() { }.getType()) .registerError(DefaultErrorResponseException.class) .build(response); }
Get all certificates in a resource group. Description for Get all certificates in a resource group.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
Throws:
Returns:the PagedList<CertificateInner> object if successful.
/** * Get all certificates in a resource group. * Description for Get all certificates 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 DefaultErrorResponseException 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&lt;CertificateInner&gt; object if successful. */
public PagedList<CertificateInner> listByResourceGroup(final String resourceGroupName) { ServiceResponse<Page<CertificateInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); return new PagedList<CertificateInner>(response.body()) { @Override public Page<CertificateInner> nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Get all certificates in a resource group. Description for Get all certificates in a resource group.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Get all certificates in a resource group. * Description for Get all certificates 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<CertificateInner>> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback<CertificateInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByResourceGroupSinglePageAsync(resourceGroupName), new Func1<String, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Get all certificates in a resource group. Description for Get all certificates in a resource group.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
Throws:
Returns:the observable to the PagedList<CertificateInner> object
/** * Get all certificates in a resource group. * Description for Get all certificates 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&lt;CertificateInner&gt; object */
public Observable<Page<CertificateInner>> listByResourceGroupAsync(final String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName) .map(new Func1<ServiceResponse<Page<CertificateInner>>, Page<CertificateInner>>() { @Override public Page<CertificateInner> call(ServiceResponse<Page<CertificateInner>> response) { return response.body(); } }); }
Get all certificates in a resource group. Description for Get all certificates in a resource group.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
Throws:
Returns:the observable to the PagedList<CertificateInner> object
/** * Get all certificates in a resource group. * Description for Get all certificates 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&lt;CertificateInner&gt; object */
public Observable<ServiceResponse<Page<CertificateInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { return listByResourceGroupSinglePageAsync(resourceGroupName) .concatMap(new Func1<ServiceResponse<Page<CertificateInner>>, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(ServiceResponse<Page<CertificateInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); }
Get all certificates in a resource group. Description for Get all certificates in a resource group. ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs.
Throws:
Returns:the PagedList<CertificateInner> object wrapped in ServiceResponse if successful.
/** * Get all certificates in a resource group. * Description for Get all certificates in a resource group. * ServiceResponse<PageImpl<CertificateInner>> * @param resourceGroupName Name of the resource group to which the resource belongs. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;CertificateInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<CertificateInner>>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<CertificateInner>> result = listByResourceGroupDelegate(response); return Observable.just(new ServiceResponse<Page<CertificateInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<CertificateInner>> listByResourceGroupDelegate(Response<ResponseBody> response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<CertificateInner>, DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<CertificateInner>>() { }.getType()) .registerError(DefaultErrorResponseException.class) .build(response); }
Get a certificate. Description for Get a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
Throws:
Returns:the CertificateInner object if successful.
/** * Get a certificate. * Description for Get a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws DefaultErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the CertificateInner object if successful. */
public CertificateInner getByResourceGroup(String resourceGroupName, String name) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); }
Get a certificate. Description for Get a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Get a certificate. * Description for Get a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @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<CertificateInner> getByResourceGroupAsync(String resourceGroupName, String name, final ServiceCallback<CertificateInner> serviceCallback) { return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, name), serviceCallback); }
Get a certificate. Description for Get a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
Throws:
Returns:the observable to the CertificateInner object
/** * Get a certificate. * Description for Get a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CertificateInner object */
public Observable<CertificateInner> getByResourceGroupAsync(String resourceGroupName, String name) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<CertificateInner>, CertificateInner>() { @Override public CertificateInner call(ServiceResponse<CertificateInner> response) { return response.body(); } }); }
Get a certificate. Description for Get a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
Throws:
Returns:the observable to the CertificateInner object
/** * Get a certificate. * Description for Get a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CertificateInner object */
public Observable<ServiceResponse<CertificateInner>> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName 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 (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.getByResourceGroup(resourceGroupName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<CertificateInner>>>() { @Override public Observable<ServiceResponse<CertificateInner>> call(Response<ResponseBody> response) { try { ServiceResponse<CertificateInner> clientResponse = getByResourceGroupDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<CertificateInner> getByResourceGroupDelegate(Response<ResponseBody> response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<CertificateInner, DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<CertificateInner>() { }.getType()) .registerError(DefaultErrorResponseException.class) .build(response); }
Create or update a certificate. Description for Create or update a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • certificateEnvelope – Details of certificate, if it exists already.
Throws:
Returns:the CertificateInner object if successful.
/** * Create or update a certificate. * Description for Create or update a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @param certificateEnvelope Details of certificate, if it exists already. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws DefaultErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the CertificateInner object if successful. */
public CertificateInner createOrUpdate(String resourceGroupName, String name, CertificateInner certificateEnvelope) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).toBlocking().single().body(); }
Create or update a certificate. Description for Create or update a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • certificateEnvelope – Details of certificate, if it exists already.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Create or update a certificate. * Description for Create or update a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @param certificateEnvelope Details of certificate, if it exists already. * @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<CertificateInner> createOrUpdateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope, final ServiceCallback<CertificateInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope), serviceCallback); }
Create or update a certificate. Description for Create or update a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • certificateEnvelope – Details of certificate, if it exists already.
Throws:
Returns:the observable to the CertificateInner object
/** * Create or update a certificate. * Description for Create or update a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @param certificateEnvelope Details of certificate, if it exists already. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CertificateInner object */
public Observable<CertificateInner> createOrUpdateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).map(new Func1<ServiceResponse<CertificateInner>, CertificateInner>() { @Override public CertificateInner call(ServiceResponse<CertificateInner> response) { return response.body(); } }); }
Create or update a certificate. Description for Create or update a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • certificateEnvelope – Details of certificate, if it exists already.
Throws:
Returns:the observable to the CertificateInner object
/** * Create or update a certificate. * Description for Create or update a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @param certificateEnvelope Details of certificate, if it exists already. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CertificateInner object */
public Observable<ServiceResponse<CertificateInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName 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 (certificateEnvelope == null) { throw new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(certificateEnvelope); return service.createOrUpdate(resourceGroupName, name, this.client.subscriptionId(), certificateEnvelope, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<CertificateInner>>>() { @Override public Observable<ServiceResponse<CertificateInner>> call(Response<ResponseBody> response) { try { ServiceResponse<CertificateInner> clientResponse = createOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<CertificateInner> createOrUpdateDelegate(Response<ResponseBody> response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<CertificateInner, DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<CertificateInner>() { }.getType()) .registerError(DefaultErrorResponseException.class) .build(response); }
Delete a certificate. Description for Delete a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
Throws:
/** * Delete a certificate. * Description for Delete a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws DefaultErrorResponseException 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 name) { deleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); }
Delete a certificate. Description for Delete a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Delete a certificate. * Description for Delete a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @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 name, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); }
Delete a certificate. Description for Delete a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
Throws:
Returns:the ServiceResponse object if successful.
/** * Delete a certificate. * Description for Delete a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> deleteAsync(String resourceGroupName, String name) { return deleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Delete a certificate. Description for Delete a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
Throws:
Returns:the ServiceResponse object if successful.
/** * Delete a certificate. * Description for Delete a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName 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 (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.delete(resourceGroupName, name, this.client.subscriptionId(), this.client.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 DefaultErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(DefaultErrorResponseException.class) .build(response); }
Create or update a certificate. Description for Create or update a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • certificateEnvelope – Details of certificate, if it exists already.
Throws:
Returns:the CertificateInner object if successful.
/** * Create or update a certificate. * Description for Create or update a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @param certificateEnvelope Details of certificate, if it exists already. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws DefaultErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the CertificateInner object if successful. */
public CertificateInner update(String resourceGroupName, String name, CertificatePatchResource certificateEnvelope) { return updateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).toBlocking().single().body(); }
Create or update a certificate. Description for Create or update a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • certificateEnvelope – Details of certificate, if it exists already.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Create or update a certificate. * Description for Create or update a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @param certificateEnvelope Details of certificate, if it exists already. * @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<CertificateInner> updateAsync(String resourceGroupName, String name, CertificatePatchResource certificateEnvelope, final ServiceCallback<CertificateInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope), serviceCallback); }
Create or update a certificate. Description for Create or update a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • certificateEnvelope – Details of certificate, if it exists already.
Throws:
Returns:the observable to the CertificateInner object
/** * Create or update a certificate. * Description for Create or update a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @param certificateEnvelope Details of certificate, if it exists already. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CertificateInner object */
public Observable<CertificateInner> updateAsync(String resourceGroupName, String name, CertificatePatchResource certificateEnvelope) { return updateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).map(new Func1<ServiceResponse<CertificateInner>, CertificateInner>() { @Override public CertificateInner call(ServiceResponse<CertificateInner> response) { return response.body(); } }); }
Create or update a certificate. Description for Create or update a certificate.
Params:
  • resourceGroupName – Name of the resource group to which the resource belongs.
  • name – Name of the certificate.
  • certificateEnvelope – Details of certificate, if it exists already.
Throws:
Returns:the observable to the CertificateInner object
/** * Create or update a certificate. * Description for Create or update a certificate. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the certificate. * @param certificateEnvelope Details of certificate, if it exists already. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the CertificateInner object */
public Observable<ServiceResponse<CertificateInner>> updateWithServiceResponseAsync(String resourceGroupName, String name, CertificatePatchResource certificateEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName 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 (certificateEnvelope == null) { throw new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(certificateEnvelope); return service.update(resourceGroupName, name, this.client.subscriptionId(), certificateEnvelope, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<CertificateInner>>>() { @Override public Observable<ServiceResponse<CertificateInner>> call(Response<ResponseBody> response) { try { ServiceResponse<CertificateInner> clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<CertificateInner> updateDelegate(Response<ResponseBody> response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<CertificateInner, DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<CertificateInner>() { }.getType()) .registerError(DefaultErrorResponseException.class) .build(response); }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<CertificateInner> object if successful.
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws DefaultErrorResponseException 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&lt;CertificateInner&gt; object if successful. */
public PagedList<CertificateInner> listNext(final String nextPageLink) { ServiceResponse<Page<CertificateInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<CertificateInner>(response.body()) { @Override public Page<CertificateInner> nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
  • serviceFuture – the ServiceFuture object tracking the Retrofit calls
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
public ServiceFuture<List<CertificateInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<CertificateInner>> serviceFuture, final ListOperationCallback<CertificateInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<CertificateInner> object
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;CertificateInner&gt; object */
public Observable<Page<CertificateInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<CertificateInner>>, Page<CertificateInner>>() { @Override public Page<CertificateInner> call(ServiceResponse<Page<CertificateInner>> response) { return response.body(); } }); }
Get all certificates for a subscription. Description for Get all certificates for a subscription.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<CertificateInner> object
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;CertificateInner&gt; object */
public Observable<ServiceResponse<Page<CertificateInner>>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<CertificateInner>>, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(ServiceResponse<Page<CertificateInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); }
Get all certificates for a subscription. Description for Get all certificates for a subscription. ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<CertificateInner> object wrapped in ServiceResponse if successful.
/** * Get all certificates for a subscription. * Description for Get all certificates for a subscription. * ServiceResponse<PageImpl<CertificateInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;CertificateInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<CertificateInner>>> 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<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<CertificateInner>> result = listNextDelegate(response); return Observable.just(new ServiceResponse<Page<CertificateInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<CertificateInner>> listNextDelegate(Response<ResponseBody> response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<CertificateInner>, DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<CertificateInner>>() { }.getType()) .registerError(DefaultErrorResponseException.class) .build(response); }
Get all certificates in a resource group. Description for Get all certificates in a resource group.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<CertificateInner> object if successful.
/** * Get all certificates in a resource group. * Description for Get all certificates 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 DefaultErrorResponseException 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&lt;CertificateInner&gt; object if successful. */
public PagedList<CertificateInner> listByResourceGroupNext(final String nextPageLink) { ServiceResponse<Page<CertificateInner>> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<CertificateInner>(response.body()) { @Override public Page<CertificateInner> nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Get all certificates in a resource group. Description for Get all certificates in a resource group.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
  • serviceFuture – the ServiceFuture object tracking the Retrofit calls
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Get all certificates in a resource group. * Description for Get all certificates 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<CertificateInner>> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture<List<CertificateInner>> serviceFuture, final ListOperationCallback<CertificateInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByResourceGroupNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Get all certificates in a resource group. Description for Get all certificates in a resource group.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<CertificateInner> object
/** * Get all certificates in a resource group. * Description for Get all certificates 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&lt;CertificateInner&gt; object */
public Observable<Page<CertificateInner>> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<CertificateInner>>, Page<CertificateInner>>() { @Override public Page<CertificateInner> call(ServiceResponse<Page<CertificateInner>> response) { return response.body(); } }); }
Get all certificates in a resource group. Description for Get all certificates in a resource group.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<CertificateInner> object
/** * Get all certificates in a resource group. * Description for Get all certificates 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&lt;CertificateInner&gt; object */
public Observable<ServiceResponse<Page<CertificateInner>>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<CertificateInner>>, Observable<ServiceResponse<Page<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(ServiceResponse<Page<CertificateInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); }
Get all certificates in a resource group. Description for Get all certificates in a resource group. ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<CertificateInner> object wrapped in ServiceResponse if successful.
/** * Get all certificates in a resource group. * Description for Get all certificates in a resource group. * ServiceResponse<PageImpl<CertificateInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;CertificateInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<CertificateInner>>> 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<CertificateInner>>>>() { @Override public Observable<ServiceResponse<Page<CertificateInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<CertificateInner>> result = listByResourceGroupNextDelegate(response); return Observable.just(new ServiceResponse<Page<CertificateInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<CertificateInner>> listByResourceGroupNextDelegate(Response<ResponseBody> response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<CertificateInner>, DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<CertificateInner>>() { }.getType()) .registerError(DefaultErrorResponseException.class) .build(response); } }