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.cdn.implementation; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.cdn.AfdErrorResponseException; import com.microsoft.azure.management.cdn.AFDOriginGroupUpdateParameters; 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 AFDOriginGroups.
/** * An instance of this class provides access to all the operations defined * in AFDOriginGroups. */
public class AFDOriginGroupsInner {
The Retrofit service to perform REST calls.
/** The Retrofit service to perform REST calls. */
private AFDOriginGroupsService service;
The service client containing this operation class.
/** The service client containing this operation class. */
private CdnManagementClientImpl client;
Initializes an instance of AFDOriginGroupsInner.
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 AFDOriginGroupsInner. * * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */
public AFDOriginGroupsInner(Retrofit retrofit, CdnManagementClientImpl client) { this.service = retrofit.create(AFDOriginGroupsService.class); this.client = client; }
The interface defining all the services for AFDOriginGroups to be used by Retrofit to perform actually REST calls.
/** * The interface defining all the services for AFDOriginGroups to be * used by Retrofit to perform actually REST calls. */
interface AFDOriginGroupsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cdn.AFDOriginGroups listByProfile" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups") Observable<Response<ResponseBody>> listByProfile(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @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.cdn.AFDOriginGroups get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") Observable<Response<ResponseBody>> get(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("originGroupName") String originGroupName, @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.cdn.AFDOriginGroups create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") Observable<Response<ResponseBody>> create(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("originGroupName") String originGroupName, @Path("subscriptionId") String subscriptionId, @Body AFDOriginGroupInner originGroup, @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.cdn.AFDOriginGroups beginCreate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") Observable<Response<ResponseBody>> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("originGroupName") String originGroupName, @Path("subscriptionId") String subscriptionId, @Body AFDOriginGroupInner originGroup, @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.cdn.AFDOriginGroups update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") Observable<Response<ResponseBody>> update(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("originGroupName") String originGroupName, @Path("subscriptionId") String subscriptionId, @Body AFDOriginGroupUpdateParameters originGroupUpdateProperties, @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.cdn.AFDOriginGroups beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}") Observable<Response<ResponseBody>> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("originGroupName") String originGroupName, @Path("subscriptionId") String subscriptionId, @Body AFDOriginGroupUpdateParameters originGroupUpdateProperties, @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.cdn.AFDOriginGroups delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("originGroupName") String originGroupName, @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.cdn.AFDOriginGroups beginDelete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("originGroupName") String originGroupName, @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.cdn.AFDOriginGroups listResourceUsage" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/usages") Observable<Response<ResponseBody>> listResourceUsage(@Path("resourceGroupName") String resourceGroupName, @Path("profileName") String profileName, @Path("originGroupName") String originGroupName, @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.cdn.AFDOriginGroups listByProfileNext" }) @GET Observable<Response<ResponseBody>> listByProfileNext(@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.cdn.AFDOriginGroups listResourceUsageNext" }) @GET Observable<Response<ResponseBody>> listResourceUsageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); }
Lists all of the existing origin groups within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
Throws:
Returns:the PagedList<AFDOriginGroupInner> object if successful.
/** * Lists all of the existing origin groups within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException 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;AFDOriginGroupInner&gt; object if successful. */
public PagedList<AFDOriginGroupInner> listByProfile(final String resourceGroupName, final String profileName) { ServiceResponse<Page<AFDOriginGroupInner>> response = listByProfileSinglePageAsync(resourceGroupName, profileName).toBlocking().single(); return new PagedList<AFDOriginGroupInner>(response.body()) { @Override public Page<AFDOriginGroupInner> nextPage(String nextPageLink) { return listByProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Lists all of the existing origin groups within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Lists all of the existing origin groups within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @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<AFDOriginGroupInner>> listByProfileAsync(final String resourceGroupName, final String profileName, final ListOperationCallback<AFDOriginGroupInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByProfileSinglePageAsync(resourceGroupName, profileName), new Func1<String, Observable<ServiceResponse<Page<AFDOriginGroupInner>>>>() { @Override public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> call(String nextPageLink) { return listByProfileNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Lists all of the existing origin groups within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
Throws:
Returns:the observable to the PagedList<AFDOriginGroupInner> object
/** * Lists all of the existing origin groups within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;AFDOriginGroupInner&gt; object */
public Observable<Page<AFDOriginGroupInner>> listByProfileAsync(final String resourceGroupName, final String profileName) { return listByProfileWithServiceResponseAsync(resourceGroupName, profileName) .map(new Func1<ServiceResponse<Page<AFDOriginGroupInner>>, Page<AFDOriginGroupInner>>() { @Override public Page<AFDOriginGroupInner> call(ServiceResponse<Page<AFDOriginGroupInner>> response) { return response.body(); } }); }
Lists all of the existing origin groups within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
Throws:
Returns:the observable to the PagedList<AFDOriginGroupInner> object
/** * Lists all of the existing origin groups within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;AFDOriginGroupInner&gt; object */
public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> listByProfileWithServiceResponseAsync(final String resourceGroupName, final String profileName) { return listByProfileSinglePageAsync(resourceGroupName, profileName) .concatMap(new Func1<ServiceResponse<Page<AFDOriginGroupInner>>, Observable<ServiceResponse<Page<AFDOriginGroupInner>>>>() { @Override public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> call(ServiceResponse<Page<AFDOriginGroupInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByProfileNextWithServiceResponseAsync(nextPageLink)); } }); }
Lists all of the existing origin groups within a profile. ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. ServiceResponse> * @param profileName Name of the CDN profile which is unique within the resource group.
Throws:
Returns:the PagedList<AFDOriginGroupInner> object wrapped in ServiceResponse if successful.
/** * Lists all of the existing origin groups within a profile. * ServiceResponse<PageImpl<AFDOriginGroupInner>> * @param resourceGroupName Name of the Resource group within the Azure subscription. ServiceResponse<PageImpl<AFDOriginGroupInner>> * @param profileName Name of the CDN profile which is unique within the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;AFDOriginGroupInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> listByProfileSinglePageAsync(final String resourceGroupName, final String profileName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName 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.listByProfile(resourceGroupName, profileName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<AFDOriginGroupInner>>>>() { @Override public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<AFDOriginGroupInner>> result = listByProfileDelegate(response); return Observable.just(new ServiceResponse<Page<AFDOriginGroupInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<AFDOriginGroupInner>> listByProfileDelegate(Response<ResponseBody> response) throws AfdErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<AFDOriginGroupInner>, AfdErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<AFDOriginGroupInner>>() { }.getType()) .registerError(AfdErrorResponseException.class) .build(response); }
Gets an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
Throws:
Returns:the AFDOriginGroupInner object if successful.
/** * Gets an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AFDOriginGroupInner object if successful. */
public AFDOriginGroupInner get(String resourceGroupName, String profileName, String originGroupName) { return getWithServiceResponseAsync(resourceGroupName, profileName, originGroupName).toBlocking().single().body(); }
Gets an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Gets an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @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<AFDOriginGroupInner> getAsync(String resourceGroupName, String profileName, String originGroupName, final ServiceCallback<AFDOriginGroupInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, profileName, originGroupName), serviceCallback); }
Gets an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
Throws:
Returns:the observable to the AFDOriginGroupInner object
/** * Gets an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AFDOriginGroupInner object */
public Observable<AFDOriginGroupInner> getAsync(String resourceGroupName, String profileName, String originGroupName) { return getWithServiceResponseAsync(resourceGroupName, profileName, originGroupName).map(new Func1<ServiceResponse<AFDOriginGroupInner>, AFDOriginGroupInner>() { @Override public AFDOriginGroupInner call(ServiceResponse<AFDOriginGroupInner> response) { return response.body(); } }); }
Gets an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
Throws:
Returns:the observable to the AFDOriginGroupInner object
/** * Gets an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AFDOriginGroupInner object */
public Observable<ServiceResponse<AFDOriginGroupInner>> getWithServiceResponseAsync(String resourceGroupName, String profileName, String originGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); } if (originGroupName == null) { throw new IllegalArgumentException("Parameter originGroupName 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.get(resourceGroupName, profileName, originGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<AFDOriginGroupInner>>>() { @Override public Observable<ServiceResponse<AFDOriginGroupInner>> call(Response<ResponseBody> response) { try { ServiceResponse<AFDOriginGroupInner> clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<AFDOriginGroupInner> getDelegate(Response<ResponseBody> response) throws AfdErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<AFDOriginGroupInner, AfdErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<AFDOriginGroupInner>() { }.getType()) .registerError(AfdErrorResponseException.class) .build(response); }
Creates a new origin group within the specified profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • originGroup – Origin group properties
Throws:
Returns:the AFDOriginGroupInner object if successful.
/** * Creates a new origin group within the specified profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @param originGroup Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AFDOriginGroupInner object if successful. */
public AFDOriginGroupInner create(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupInner originGroup) { return createWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroup).toBlocking().last().body(); }
Creates a new origin group within the specified profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • originGroup – Origin group properties
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates a new origin group within the specified profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @param originGroup Origin group 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<AFDOriginGroupInner> createAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupInner originGroup, final ServiceCallback<AFDOriginGroupInner> serviceCallback) { return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroup), serviceCallback); }
Creates a new origin group within the specified profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • originGroup – Origin group properties
Throws:
Returns:the observable for the request
/** * Creates a new origin group within the specified profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @param originGroup Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<AFDOriginGroupInner> createAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupInner originGroup) { return createWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroup).map(new Func1<ServiceResponse<AFDOriginGroupInner>, AFDOriginGroupInner>() { @Override public AFDOriginGroupInner call(ServiceResponse<AFDOriginGroupInner> response) { return response.body(); } }); }
Creates a new origin group within the specified profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • originGroup – Origin group properties
Throws:
Returns:the observable for the request
/** * Creates a new origin group within the specified profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @param originGroup Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<AFDOriginGroupInner>> createWithServiceResponseAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupInner originGroup) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); } if (originGroupName == null) { throw new IllegalArgumentException("Parameter originGroupName 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 (originGroup == null) { throw new IllegalArgumentException("Parameter originGroup 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(originGroup); Observable<Response<ResponseBody>> observable = service.create(resourceGroupName, profileName, originGroupName, this.client.subscriptionId(), originGroup, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<AFDOriginGroupInner>() { }.getType()); }
Creates a new origin group within the specified profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • originGroup – Origin group properties
Throws:
Returns:the AFDOriginGroupInner object if successful.
/** * Creates a new origin group within the specified profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @param originGroup Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AFDOriginGroupInner object if successful. */
public AFDOriginGroupInner beginCreate(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupInner originGroup) { return beginCreateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroup).toBlocking().single().body(); }
Creates a new origin group within the specified profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • originGroup – Origin group properties
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates a new origin group within the specified profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @param originGroup Origin group 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<AFDOriginGroupInner> beginCreateAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupInner originGroup, final ServiceCallback<AFDOriginGroupInner> serviceCallback) { return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroup), serviceCallback); }
Creates a new origin group within the specified profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • originGroup – Origin group properties
Throws:
Returns:the observable to the AFDOriginGroupInner object
/** * Creates a new origin group within the specified profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @param originGroup Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AFDOriginGroupInner object */
public Observable<AFDOriginGroupInner> beginCreateAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupInner originGroup) { return beginCreateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroup).map(new Func1<ServiceResponse<AFDOriginGroupInner>, AFDOriginGroupInner>() { @Override public AFDOriginGroupInner call(ServiceResponse<AFDOriginGroupInner> response) { return response.body(); } }); }
Creates a new origin group within the specified profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • originGroup – Origin group properties
Throws:
Returns:the observable to the AFDOriginGroupInner object
/** * Creates a new origin group within the specified profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @param originGroup Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AFDOriginGroupInner object */
public Observable<ServiceResponse<AFDOriginGroupInner>> beginCreateWithServiceResponseAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupInner originGroup) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); } if (originGroupName == null) { throw new IllegalArgumentException("Parameter originGroupName 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 (originGroup == null) { throw new IllegalArgumentException("Parameter originGroup 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(originGroup); return service.beginCreate(resourceGroupName, profileName, originGroupName, this.client.subscriptionId(), originGroup, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<AFDOriginGroupInner>>>() { @Override public Observable<ServiceResponse<AFDOriginGroupInner>> call(Response<ResponseBody> response) { try { ServiceResponse<AFDOriginGroupInner> clientResponse = beginCreateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<AFDOriginGroupInner> beginCreateDelegate(Response<ResponseBody> response) throws AfdErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<AFDOriginGroupInner, AfdErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<AFDOriginGroupInner>() { }.getType()) .register(201, new TypeToken<AFDOriginGroupInner>() { }.getType()) .register(202, new TypeToken<AFDOriginGroupInner>() { }.getType()) .registerError(AfdErrorResponseException.class) .build(response); }
Updates an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • originGroupUpdateProperties – Origin group properties
Throws:
Returns:the AFDOriginGroupInner object if successful.
/** * Updates an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @param originGroupUpdateProperties Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AFDOriginGroupInner object if successful. */
public AFDOriginGroupInner update(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupUpdateParameters originGroupUpdateProperties) { return updateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties).toBlocking().last().body(); }
Updates an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • originGroupUpdateProperties – Origin group properties
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Updates an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @param originGroupUpdateProperties Origin group 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<AFDOriginGroupInner> updateAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupUpdateParameters originGroupUpdateProperties, final ServiceCallback<AFDOriginGroupInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties), serviceCallback); }
Updates an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • originGroupUpdateProperties – Origin group properties
Throws:
Returns:the observable for the request
/** * Updates an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @param originGroupUpdateProperties Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<AFDOriginGroupInner> updateAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupUpdateParameters originGroupUpdateProperties) { return updateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties).map(new Func1<ServiceResponse<AFDOriginGroupInner>, AFDOriginGroupInner>() { @Override public AFDOriginGroupInner call(ServiceResponse<AFDOriginGroupInner> response) { return response.body(); } }); }
Updates an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • originGroupUpdateProperties – Origin group properties
Throws:
Returns:the observable for the request
/** * Updates an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @param originGroupUpdateProperties Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<AFDOriginGroupInner>> updateWithServiceResponseAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupUpdateParameters originGroupUpdateProperties) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); } if (originGroupName == null) { throw new IllegalArgumentException("Parameter originGroupName 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 (originGroupUpdateProperties == null) { throw new IllegalArgumentException("Parameter originGroupUpdateProperties 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(originGroupUpdateProperties); Observable<Response<ResponseBody>> observable = service.update(resourceGroupName, profileName, originGroupName, this.client.subscriptionId(), originGroupUpdateProperties, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<AFDOriginGroupInner>() { }.getType()); }
Updates an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • originGroupUpdateProperties – Origin group properties
Throws:
Returns:the AFDOriginGroupInner object if successful.
/** * Updates an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @param originGroupUpdateProperties Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AFDOriginGroupInner object if successful. */
public AFDOriginGroupInner beginUpdate(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupUpdateParameters originGroupUpdateProperties) { return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties).toBlocking().single().body(); }
Updates an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • originGroupUpdateProperties – Origin group properties
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Updates an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @param originGroupUpdateProperties Origin group 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<AFDOriginGroupInner> beginUpdateAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupUpdateParameters originGroupUpdateProperties, final ServiceCallback<AFDOriginGroupInner> serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties), serviceCallback); }
Updates an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • originGroupUpdateProperties – Origin group properties
Throws:
Returns:the observable to the AFDOriginGroupInner object
/** * Updates an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @param originGroupUpdateProperties Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AFDOriginGroupInner object */
public Observable<AFDOriginGroupInner> beginUpdateAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupUpdateParameters originGroupUpdateProperties) { return beginUpdateWithServiceResponseAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties).map(new Func1<ServiceResponse<AFDOriginGroupInner>, AFDOriginGroupInner>() { @Override public AFDOriginGroupInner call(ServiceResponse<AFDOriginGroupInner> response) { return response.body(); } }); }
Updates an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • originGroupUpdateProperties – Origin group properties
Throws:
Returns:the observable to the AFDOriginGroupInner object
/** * Updates an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @param originGroupUpdateProperties Origin group properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AFDOriginGroupInner object */
public Observable<ServiceResponse<AFDOriginGroupInner>> beginUpdateWithServiceResponseAsync(String resourceGroupName, String profileName, String originGroupName, AFDOriginGroupUpdateParameters originGroupUpdateProperties) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); } if (originGroupName == null) { throw new IllegalArgumentException("Parameter originGroupName 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 (originGroupUpdateProperties == null) { throw new IllegalArgumentException("Parameter originGroupUpdateProperties 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(originGroupUpdateProperties); return service.beginUpdate(resourceGroupName, profileName, originGroupName, this.client.subscriptionId(), originGroupUpdateProperties, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<AFDOriginGroupInner>>>() { @Override public Observable<ServiceResponse<AFDOriginGroupInner>> call(Response<ResponseBody> response) { try { ServiceResponse<AFDOriginGroupInner> clientResponse = beginUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<AFDOriginGroupInner> beginUpdateDelegate(Response<ResponseBody> response) throws AfdErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<AFDOriginGroupInner, AfdErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<AFDOriginGroupInner>() { }.getType()) .register(202, new TypeToken<AFDOriginGroupInner>() { }.getType()) .registerError(AfdErrorResponseException.class) .build(response); }
Deletes an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
Throws:
/** * Deletes an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException 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 profileName, String originGroupName) { deleteWithServiceResponseAsync(resourceGroupName, profileName, originGroupName).toBlocking().last().body(); }
Deletes an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @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 profileName, String originGroupName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, profileName, originGroupName), serviceCallback); }
Deletes an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
Throws:
Returns:the observable for the request
/** * Deletes an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<Void> deleteAsync(String resourceGroupName, String profileName, String originGroupName) { return deleteWithServiceResponseAsync(resourceGroupName, profileName, originGroupName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
Throws:
Returns:the observable for the request
/** * Deletes an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String profileName, String originGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); } if (originGroupName == null) { throw new IllegalArgumentException("Parameter originGroupName 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."); } Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, profileName, originGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Deletes an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
Throws:
/** * Deletes an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void beginDelete(String resourceGroupName, String profileName, String originGroupName) { beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, originGroupName).toBlocking().single().body(); }
Deletes an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @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> beginDeleteAsync(String resourceGroupName, String profileName, String originGroupName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, originGroupName), serviceCallback); }
Deletes an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> beginDeleteAsync(String resourceGroupName, String profileName, String originGroupName) { return beginDeleteWithServiceResponseAsync(resourceGroupName, profileName, originGroupName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes an existing origin group within a profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the profile.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes an existing origin group within a profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the profile. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String profileName, String originGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); } if (originGroupName == null) { throw new IllegalArgumentException("Parameter originGroupName 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.beginDelete(resourceGroupName, profileName, originGroupName, 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 = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> beginDeleteDelegate(Response<ResponseBody> response) throws AfdErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, AfdErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(202, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(AfdErrorResponseException.class) .build(response); }
Checks the quota and actual usage of endpoints under the given CDN profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
Throws:
Returns:the PagedList<UsageInner> object if successful.
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException 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;UsageInner&gt; object if successful. */
public PagedList<UsageInner> listResourceUsage(final String resourceGroupName, final String profileName, final String originGroupName) { ServiceResponse<Page<UsageInner>> response = listResourceUsageSinglePageAsync(resourceGroupName, profileName, originGroupName).toBlocking().single(); return new PagedList<UsageInner>(response.body()) { @Override public Page<UsageInner> nextPage(String nextPageLink) { return listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Checks the quota and actual usage of endpoints under the given CDN profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @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<UsageInner>> listResourceUsageAsync(final String resourceGroupName, final String profileName, final String originGroupName, final ListOperationCallback<UsageInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listResourceUsageSinglePageAsync(resourceGroupName, profileName, originGroupName), new Func1<String, Observable<ServiceResponse<Page<UsageInner>>>>() { @Override public Observable<ServiceResponse<Page<UsageInner>>> call(String nextPageLink) { return listResourceUsageNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Checks the quota and actual usage of endpoints under the given CDN profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
Throws:
Returns:the observable to the PagedList<UsageInner> object
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;UsageInner&gt; object */
public Observable<Page<UsageInner>> listResourceUsageAsync(final String resourceGroupName, final String profileName, final String originGroupName) { return listResourceUsageWithServiceResponseAsync(resourceGroupName, profileName, originGroupName) .map(new Func1<ServiceResponse<Page<UsageInner>>, Page<UsageInner>>() { @Override public Page<UsageInner> call(ServiceResponse<Page<UsageInner>> response) { return response.body(); } }); }
Checks the quota and actual usage of endpoints under the given CDN profile.
Params:
  • resourceGroupName – Name of the Resource group within the Azure subscription.
  • profileName – Name of the CDN profile which is unique within the resource group.
  • originGroupName – Name of the origin group which is unique within the endpoint.
Throws:
Returns:the observable to the PagedList<UsageInner> object
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the CDN profile which is unique within the resource group. * @param originGroupName Name of the origin group which is unique within the endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;UsageInner&gt; object */
public Observable<ServiceResponse<Page<UsageInner>>> listResourceUsageWithServiceResponseAsync(final String resourceGroupName, final String profileName, final String originGroupName) { return listResourceUsageSinglePageAsync(resourceGroupName, profileName, originGroupName) .concatMap(new Func1<ServiceResponse<Page<UsageInner>>, Observable<ServiceResponse<Page<UsageInner>>>>() { @Override public Observable<ServiceResponse<Page<UsageInner>>> call(ServiceResponse<Page<UsageInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listResourceUsageNextWithServiceResponseAsync(nextPageLink)); } }); }
Checks the quota and actual usage of endpoints under the given CDN profile. ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. ServiceResponse> * @param profileName Name of the CDN profile which is unique within the resource group. ServiceResponse> * @param originGroupName Name of the origin group which is unique within the endpoint.
Throws:
Returns:the PagedList<UsageInner> object wrapped in ServiceResponse if successful.
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * ServiceResponse<PageImpl<UsageInner>> * @param resourceGroupName Name of the Resource group within the Azure subscription. ServiceResponse<PageImpl<UsageInner>> * @param profileName Name of the CDN profile which is unique within the resource group. ServiceResponse<PageImpl<UsageInner>> * @param originGroupName Name of the origin group which is unique within the endpoint. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;UsageInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<UsageInner>>> listResourceUsageSinglePageAsync(final String resourceGroupName, final String profileName, final String originGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (profileName == null) { throw new IllegalArgumentException("Parameter profileName is required and cannot be null."); } if (originGroupName == null) { throw new IllegalArgumentException("Parameter originGroupName 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.listResourceUsage(resourceGroupName, profileName, originGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<UsageInner>>>>() { @Override public Observable<ServiceResponse<Page<UsageInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<UsageInner>> result = listResourceUsageDelegate(response); return Observable.just(new ServiceResponse<Page<UsageInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<UsageInner>> listResourceUsageDelegate(Response<ResponseBody> response) throws AfdErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<UsageInner>, AfdErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<UsageInner>>() { }.getType()) .registerError(AfdErrorResponseException.class) .build(response); }
Lists all of the existing origin groups within a profile.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<AFDOriginGroupInner> object if successful.
/** * Lists all of the existing origin groups within a profile. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException 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;AFDOriginGroupInner&gt; object if successful. */
public PagedList<AFDOriginGroupInner> listByProfileNext(final String nextPageLink) { ServiceResponse<Page<AFDOriginGroupInner>> response = listByProfileNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<AFDOriginGroupInner>(response.body()) { @Override public Page<AFDOriginGroupInner> nextPage(String nextPageLink) { return listByProfileNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Lists all of the existing origin groups within a profile.
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
/** * Lists all of the existing origin groups within a profile. * * @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<AFDOriginGroupInner>> listByProfileNextAsync(final String nextPageLink, final ServiceFuture<List<AFDOriginGroupInner>> serviceFuture, final ListOperationCallback<AFDOriginGroupInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByProfileNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<AFDOriginGroupInner>>>>() { @Override public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> call(String nextPageLink) { return listByProfileNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Lists all of the existing origin groups within a profile.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<AFDOriginGroupInner> object
/** * Lists all of the existing origin groups within a profile. * * @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;AFDOriginGroupInner&gt; object */
public Observable<Page<AFDOriginGroupInner>> listByProfileNextAsync(final String nextPageLink) { return listByProfileNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<AFDOriginGroupInner>>, Page<AFDOriginGroupInner>>() { @Override public Page<AFDOriginGroupInner> call(ServiceResponse<Page<AFDOriginGroupInner>> response) { return response.body(); } }); }
Lists all of the existing origin groups within a profile.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<AFDOriginGroupInner> object
/** * Lists all of the existing origin groups within a profile. * * @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;AFDOriginGroupInner&gt; object */
public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> listByProfileNextWithServiceResponseAsync(final String nextPageLink) { return listByProfileNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<AFDOriginGroupInner>>, Observable<ServiceResponse<Page<AFDOriginGroupInner>>>>() { @Override public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> call(ServiceResponse<Page<AFDOriginGroupInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByProfileNextWithServiceResponseAsync(nextPageLink)); } }); }
Lists all of the existing origin groups within a profile. ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<AFDOriginGroupInner> object wrapped in ServiceResponse if successful.
/** * Lists all of the existing origin groups within a profile. * ServiceResponse<PageImpl<AFDOriginGroupInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;AFDOriginGroupInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> listByProfileNextSinglePageAsync(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.listByProfileNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<AFDOriginGroupInner>>>>() { @Override public Observable<ServiceResponse<Page<AFDOriginGroupInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<AFDOriginGroupInner>> result = listByProfileNextDelegate(response); return Observable.just(new ServiceResponse<Page<AFDOriginGroupInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<AFDOriginGroupInner>> listByProfileNextDelegate(Response<ResponseBody> response) throws AfdErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<AFDOriginGroupInner>, AfdErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<AFDOriginGroupInner>>() { }.getType()) .registerError(AfdErrorResponseException.class) .build(response); }
Checks the quota and actual usage of endpoints under the given CDN profile.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<UsageInner> object if successful.
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws AfdErrorResponseException 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;UsageInner&gt; object if successful. */
public PagedList<UsageInner> listResourceUsageNext(final String nextPageLink) { ServiceResponse<Page<UsageInner>> response = listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<UsageInner>(response.body()) { @Override public Page<UsageInner> nextPage(String nextPageLink) { return listResourceUsageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Checks the quota and actual usage of endpoints under the given CDN profile.
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
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * * @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<UsageInner>> listResourceUsageNextAsync(final String nextPageLink, final ServiceFuture<List<UsageInner>> serviceFuture, final ListOperationCallback<UsageInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listResourceUsageNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<UsageInner>>>>() { @Override public Observable<ServiceResponse<Page<UsageInner>>> call(String nextPageLink) { return listResourceUsageNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Checks the quota and actual usage of endpoints under the given CDN profile.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<UsageInner> object
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * * @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;UsageInner&gt; object */
public Observable<Page<UsageInner>> listResourceUsageNextAsync(final String nextPageLink) { return listResourceUsageNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<UsageInner>>, Page<UsageInner>>() { @Override public Page<UsageInner> call(ServiceResponse<Page<UsageInner>> response) { return response.body(); } }); }
Checks the quota and actual usage of endpoints under the given CDN profile.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<UsageInner> object
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * * @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;UsageInner&gt; object */
public Observable<ServiceResponse<Page<UsageInner>>> listResourceUsageNextWithServiceResponseAsync(final String nextPageLink) { return listResourceUsageNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<UsageInner>>, Observable<ServiceResponse<Page<UsageInner>>>>() { @Override public Observable<ServiceResponse<Page<UsageInner>>> call(ServiceResponse<Page<UsageInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listResourceUsageNextWithServiceResponseAsync(nextPageLink)); } }); }
Checks the quota and actual usage of endpoints under the given CDN profile. ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<UsageInner> object wrapped in ServiceResponse if successful.
/** * Checks the quota and actual usage of endpoints under the given CDN profile. * ServiceResponse<PageImpl<UsageInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;UsageInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<UsageInner>>> listResourceUsageNextSinglePageAsync(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.listResourceUsageNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<UsageInner>>>>() { @Override public Observable<ServiceResponse<Page<UsageInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<UsageInner>> result = listResourceUsageNextDelegate(response); return Observable.just(new ServiceResponse<Page<UsageInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<UsageInner>> listResourceUsageNextDelegate(Response<ResponseBody> response) throws AfdErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<UsageInner>, AfdErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<UsageInner>>() { }.getType()) .registerError(AfdErrorResponseException.class) .build(response); } }