Search in sources :

Example 1 with SkuName

use of com.microsoft.azure.management.appservice.SkuName in project azure-sdk-for-java by Azure.

the class WebSiteManagementClientImpl method listGeoRegionsSinglePageAsync.

/**
     * Get a list of available geographical regions.
     * Get a list of available geographical regions.
     *
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList<GeoRegionInner> object wrapped in {@link ServiceResponse} if successful.
     */
public Observable<ServiceResponse<Page<GeoRegionInner>>> listGeoRegionsSinglePageAsync() {
    if (this.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null.");
    }
    final String apiVersion = "2016-03-01";
    final SkuName sku = null;
    final Boolean linuxWorkersEnabled = null;
    return service.listGeoRegions(this.subscriptionId(), sku, linuxWorkersEnabled, apiVersion, this.acceptLanguage(), this.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<GeoRegionInner>>>>() {

        @Override
        public Observable<ServiceResponse<Page<GeoRegionInner>>> call(Response<ResponseBody> response) {
            try {
                ServiceResponse<PageImpl<GeoRegionInner>> result = listGeoRegionsDelegate(response);
                return Observable.just(new ServiceResponse<Page<GeoRegionInner>>(result.body(), result.response()));
            } catch (Throwable t) {
                return Observable.error(t);
            }
        }
    });
}
Also used : Page(com.microsoft.azure.Page) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody) Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) ServiceResponse(com.microsoft.rest.ServiceResponse) SkuName(com.microsoft.azure.management.appservice.SkuName)

Aggregations

Page (com.microsoft.azure.Page)1 SkuName (com.microsoft.azure.management.appservice.SkuName)1 ServiceResponse (com.microsoft.rest.ServiceResponse)1 ResponseBody (okhttp3.ResponseBody)1 Response (retrofit2.Response)1 Observable (rx.Observable)1