Java 类rx.functions.Func1 实例源码

项目:autorest.java    文件:LROsImpl.java   
/**
 * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status.
 *
 * @param product Product to put
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the Product object
 */
public Observable<ServiceResponseWithHeaders<Product, LROsPutAsyncNoRetrySucceededHeaders>> beginPutAsyncNoRetrySucceededWithServiceResponseAsync(Product product) {
    Validator.validate(product);
    return service.beginPutAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Product, LROsPutAsyncNoRetrySucceededHeaders>>>() {
            @Override
            public Observable<ServiceResponseWithHeaders<Product, LROsPutAsyncNoRetrySucceededHeaders>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponseWithHeaders<Product, LROsPutAsyncNoRetrySucceededHeaders> clientResponse = beginPutAsyncNoRetrySucceededDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:autorest.java    文件:Datetimerfc1123sImpl.java   
/**
 * Get null datetime value.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the DateTime object
 */
public Observable<ServiceResponse<DateTime>> getNullWithServiceResponseAsync() {
    return service.getNull()
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DateTime>>>() {
            @Override
            public Observable<ServiceResponse<DateTime>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<DateTimeRfc1123> result = getNullDelegate(response);
                    DateTime body = null;
                    if (result.body() != null) {
                        body = result.body().dateTime();
                    }
                    ServiceResponse<DateTime> clientResponse = new ServiceResponse<DateTime>(body, result.response());
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:TripBuyer    文件:A.java   
/**
 * 用密码登录的接口
 */
public void login_usepwd(HttpResultListener<Boolean> subscriber, final String tel, final String code) {
    mApi.login_usepwd(tel, code)
            .map(new HttpResultFuncNoList_has_obj())
            .map(new Func1<Obj, Boolean>() {

                @Override
                public Boolean call(Obj o) {
                    if (o != null) {
                        Shared.saveUserInfo(o);
                        //Log.i("lin", "----" + o.getIsReal());
                        Log.i("lin", "=====lin=====>   保存的用户姓名 3333" + o.getName());
                        return true;
                    } else {
                        return false;
                    }
                }
            })
            .subscribeOn(Schedulers.io())//在工作线程请求网络
            .observeOn(AndroidSchedulers.mainThread())//在主线程处理结果
            .subscribe(new HttpResultSubscriber<>(subscriber));
}
项目:azure-libraries-for-java    文件:StorageAccountsImpl.java   
/**
 * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any.
 *
ServiceResponse<PageImpl<StorageContainer>> * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;StorageContainer&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<StorageContainer>>> listStorageContainersNextSinglePageAsync(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.listStorageContainersNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<StorageContainer>>>>() {
            @Override
            public Observable<ServiceResponse<Page<StorageContainer>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<StorageContainer>> result = listStorageContainersNextDelegate(response);
                    return Observable.just(new ServiceResponse<Page<StorageContainer>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:WebSiteManagementClientImpl.java   
/**
 * Validate whether a resource can be moved.
 * Validate whether a resource can be moved.
 *
 * @param resourceGroupName Name of the resource group to which the resource belongs.
 * @param moveResourceEnvelope Object that represents the resource to move.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponse} object if successful.
 */
public Observable<ServiceResponse<Void>> validateMoveWithServiceResponseAsync(String resourceGroupName, CsmMoveResourceEnvelopeInner moveResourceEnvelope) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (this.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null.");
    }
    if (moveResourceEnvelope == null) {
        throw new IllegalArgumentException("Parameter moveResourceEnvelope is required and cannot be null.");
    }
    Validator.validate(moveResourceEnvelope);
    final String apiVersion = "2016-03-01";
    return service.validateMove(resourceGroupName, this.subscriptionId(), moveResourceEnvelope, apiVersion, this.acceptLanguage(), this.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
            @Override
            public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<Void> clientResponse = validateMoveDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:Utils.java   
/**
 * Converts the given list of a type to paged list of a different type.
 *
 * @param list the list to convert to paged list
 * @param mapper the mapper to map type in input list to output list
 * @param <OutT> the type of items in output paged list
 * @param <InT> the type of items in input paged list
 * @return the paged list
 */
public static <OutT, InT> PagedList<OutT> toPagedList(List<InT> list, final Func1<InT, OutT> mapper) {
    PageImpl<InT> page = new PageImpl<>();
    page.setItems(list);
    page.setNextPageLink(null);
    PagedList<InT> pagedList = new PagedList<InT>(page) {
        @Override
        public Page<InT> nextPage(String nextPageLink) {
            return null;
        }
    };
    PagedListConverter<InT, OutT> converter = new PagedListConverter<InT, OutT>() {
        @Override
        public Observable<OutT> typeConvertAsync(InT inner) {
            return Observable.just(mapper.call(inner));
        }
    };
    return converter.convert(pagedList);
}
项目:Transmission    文件:ToastUtil.java   
public static void toast(int resId) {
    Observable.just(resId)
            .subscribeOn(Schedulers.io())
            .map(new Func1<Integer, String>() {
                @Override
                public String call(Integer integer) {
                    return App.context.getResources().getString(integer);
                }
            })
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Action1<String>() {
                @Override
                public void call(String s) {
                    try {
                        if (mToast != null) {
                            mToast.cancel();
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    mToast = Toast.makeText(App.context, s, Toast.LENGTH_SHORT);
                    mToast.setGravity(Gravity.CENTER, 0, 0);
                    mToast.show();
                }
            });
}
项目:azure-libraries-for-java    文件:UsageDetailsInner.java   
/**
 * Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
 *
ServiceResponse<PageImpl<UsageDetailInner>> * @param scope The scope of the usage details. The scope can be '/subscriptions/{subscriptionId}' for a subscription, or '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' for a billing perdiod.
ServiceResponse<PageImpl<UsageDetailInner>> * @param expand May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details.
ServiceResponse<PageImpl<UsageDetailInner>> * @param filter May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.
ServiceResponse<PageImpl<UsageDetailInner>> * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.
ServiceResponse<PageImpl<UsageDetailInner>> * @param top May be used to limit the number of results to the most recent N usageDetails.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;UsageDetailInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<UsageDetailInner>>> listSinglePageAsync(final String scope, final String expand, final String filter, final String skiptoken, final Integer top) {
    if (scope == null) {
        throw new IllegalArgumentException("Parameter scope 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(scope, expand, filter, skiptoken, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<UsageDetailInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<UsageDetailInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<UsageDetailInner>> result = listDelegate(response);
                    return Observable.just(new ServiceResponse<Page<UsageDetailInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:ActivityLogsInner.java   
/**
 * Provides the list of records from the activity logs.
 *
ServiceResponse<PageImpl1<EventDataInner>> * @param filter Reduces the set of data collected.&lt;br&gt;The **$filter** argument is very restricted and allows only the following patterns.&lt;br&gt;- *List events for a resource group*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.&lt;br&gt;- *List events for resource*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.&lt;br&gt;- *List events for a subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.&lt;br&gt;- *List events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.&lt;br&gt;- *List events for a correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.&lt;br&gt;&lt;br&gt;**NOTE**: No other syntax is allowed.
ServiceResponse<PageImpl1<EventDataInner>> * @param select Used to fetch events with only the given properties.&lt;br&gt;The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;EventDataInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<EventDataInner>>> listSinglePageAsync(final String filter, final String select) {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    final String apiVersion = "2015-04-01";
    return service.list(this.client.subscriptionId(), apiVersion, filter, select, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventDataInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<EventDataInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl1<EventDataInner>> result = listDelegate(response);
                    return Observable.just(new ServiceResponse<Page<EventDataInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:autorest.java    文件:QueriesImpl.java   
/**
 * Get '-9999999.999' numeric value.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponse} object if successful.
 */
public Observable<ServiceResponse<Void>> doubleDecimalNegativeWithServiceResponseAsync() {
    final double doubleQuery = -9999999.999;
    return service.doubleDecimalNegative(doubleQuery)
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
            @Override
            public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<Void> clientResponse = doubleDecimalNegativeDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:WebAppsInner.java   
/**
 * Gets all metric definitions of an app (or deployment slot, if specified).
 * Gets all metric definitions of an app (or deployment slot, if specified).
 *
ServiceResponse<PageImpl<ResourceMetricDefinitionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;ResourceMetricDefinitionInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMetricDefinitionsSlotNextSinglePageAsync(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.listMetricDefinitionsSlotNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<ResourceMetricDefinitionInner>> result = listMetricDefinitionsSlotNextDelegate(response);
                    return Observable.just(new ServiceResponse<Page<ResourceMetricDefinitionInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:OperationsInner.java   
/**
 * Lists all of the available Azure Container Registry REST API operations.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;OperationDefinitionInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<OperationDefinitionInner>>> listSinglePageAsync() {
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<OperationDefinitionInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<OperationDefinitionInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<OperationDefinitionInner>> result = listDelegate(response);
                    return Observable.just(new ServiceResponse<Page<OperationDefinitionInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:autorest.java    文件:QueriesImpl.java   
/**
 * Get '9999999.999' numeric value.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponse} object if successful.
 */
public Observable<ServiceResponse<Void>> doubleDecimalPositiveWithServiceResponseAsync() {
    final double doubleQuery = 9999999.999;
    return service.doubleDecimalPositive(doubleQuery)
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
            @Override
            public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<Void> clientResponse = doubleDecimalPositiveDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:autorest.java    文件:PathsImpl.java   
/**
 * Get '2012-01-01T01:01:01Z' as date-time.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponse} object if successful.
 */
public Observable<ServiceResponse<Void>> dateTimeValidWithServiceResponseAsync() {
    final DateTime dateTimePath = DateTime.parse("2012-01-01T01:01:01Z");
    return service.dateTimeValid(dateTimePath)
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
            @Override
            public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<Void> clientResponse = dateTimeValidDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:StreamingJobsInner.java   
/**
 * Starts a streaming job. Once a job is started it will start processing input events and produce output.
 *
 * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
 * @param jobName The name of the streaming job.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponse} object if successful.
 */
public Observable<ServiceResponse<Void>> beginStartWithServiceResponseAsync(String resourceGroupName, String jobName) {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (jobName == null) {
        throw new IllegalArgumentException("Parameter jobName is required and cannot be null.");
    }
    final String apiVersion = "2016-03-01";
    final StartStreamingJobParametersInner startJobParameters = null;
    return service.beginStart(this.client.subscriptionId(), resourceGroupName, jobName, startJobParameters, 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 = beginStartDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:autorest.java    文件:HeadersImpl.java   
/**
 * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request.
 *
 * @param fooClientRequestId The fooRequestId
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the Boolean object
 */
public Observable<ServiceResponseWithHeaders<Boolean, HeaderCustomNamedRequestIdHeadHeaders>> customNamedRequestIdHeadWithServiceResponseAsync(String fooClientRequestId) {
    if (fooClientRequestId == null) {
        throw new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null.");
    }
    return service.customNamedRequestIdHead(fooClientRequestId, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<Void>, Observable<ServiceResponseWithHeaders<Boolean, HeaderCustomNamedRequestIdHeadHeaders>>>() {
            @Override
            public Observable<ServiceResponseWithHeaders<Boolean, HeaderCustomNamedRequestIdHeadHeaders>> call(Response<Void> response) {
                try {
                    ServiceResponseWithHeaders<Boolean, HeaderCustomNamedRequestIdHeadHeaders> clientResponse = customNamedRequestIdHeadDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:Bailan    文件:RetryWhenNetworkException.java   
@Override
public Observable<?> call(Observable<? extends Throwable> observable) {
    return observable
            .zipWith(Observable.range(1, count + 1), new Func2<Throwable, Integer, Wrapper>() {
                @Override
                public Wrapper call(Throwable throwable, Integer integer) {
                    //压缩规则 合并后的结果是一个Observable<Wrapper>
                    return new Wrapper(throwable, integer);
                }
            }).flatMap(new Func1<Wrapper, Observable<?>>() {
                @Override
                public Observable<?> call(Wrapper wrapper) {
                    //转换规则
                    if ((wrapper.throwable instanceof ConnectException
                            || wrapper.throwable instanceof SocketTimeoutException
                            || wrapper.throwable instanceof TimeoutException)
                            && wrapper.index < count + 1) { //如果超出重试次数也抛出错误,否则默认是会进入onCompleted
                        return Observable.timer(delay + (wrapper.index - 1) * increaseDelay, TimeUnit.MILLISECONDS);

                    }
                    return Observable.error(wrapper.throwable);
                }
            });
}
项目:azure-libraries-for-java    文件:NetworkManagementClientImpl.java   
/**
 * Checks whether a domain name in the cloudapp.net zone is available for use.
 *
 * @param location The location of the domain name.
 * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the DnsNameAvailabilityResultInner object
 */
public Observable<ServiceResponse<DnsNameAvailabilityResultInner>> checkDnsNameAvailabilityWithServiceResponseAsync(String location, String domainNameLabel) {
    if (location == null) {
        throw new IllegalArgumentException("Parameter location is required and cannot be null.");
    }
    if (this.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null.");
    }
    final String apiVersion = "2017-08-01";
    return service.checkDnsNameAvailability(location, this.subscriptionId(), domainNameLabel, apiVersion, this.acceptLanguage(), this.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DnsNameAvailabilityResultInner>>>() {
            @Override
            public Observable<ServiceResponse<DnsNameAvailabilityResultInner>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<DnsNameAvailabilityResultInner> clientResponse = checkDnsNameAvailabilityDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:AppServiceEnvironmentsInner.java   
/**
 * Get metrics for a specific instance of a worker pool of an App Service Environment.
 * Get metrics for a specific instance of a worker pool of an App Service Environment.
 *
ServiceResponse<PageImpl<ResourceMetricInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;ResourceMetricInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<ResourceMetricInner>>> listWorkerPoolInstanceMetricsNextSinglePageAsync(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.listWorkerPoolInstanceMetricsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ResourceMetricInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<ResourceMetricInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<ResourceMetricInner>> result = listWorkerPoolInstanceMetricsNextDelegate(response);
                    return Observable.just(new ServiceResponse<Page<ResourceMetricInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:AppServicePlansInner.java   
/**
 * Create or update a Virtual Network route in an App Service plan.
 * Create or update a Virtual Network route in an App Service plan.
 *
 * @param resourceGroupName Name of the resource group to which the resource belongs.
 * @param name Name of the App Service plan.
 * @param vnetName Name of the Virtual Network.
 * @param routeName Name of the Virtual Network route.
 * @param route Definition of the Virtual Network route.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the VnetRouteInner object
 */
public Observable<ServiceResponse<VnetRouteInner>> updateVnetRouteWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) {
    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 (vnetName == null) {
        throw new IllegalArgumentException("Parameter vnetName is required and cannot be null.");
    }
    if (routeName == null) {
        throw new IllegalArgumentException("Parameter routeName 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 (route == null) {
        throw new IllegalArgumentException("Parameter route is required and cannot be null.");
    }
    Validator.validate(route);
    final String apiVersion = "2016-09-01";
    return service.updateVnetRoute(resourceGroupName, name, vnetName, routeName, this.client.subscriptionId(), route, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<VnetRouteInner>>>() {
            @Override
            public Observable<ServiceResponse<VnetRouteInner>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<VnetRouteInner> clientResponse = updateVnetRouteDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:HybridConnectionsInner.java   
/**
 * Creates or Updates a service HybridConnection. This operation is idempotent.
 *
 * @param resourceGroupName Name of the Resource group within the Azure subscription.
 * @param namespaceName The Namespace Name
 * @param hybridConnectionName The hybrid connection name.
 * @param parameters Parameters supplied to create a HybridConnection.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the HybridConnectionInner object
 */
public Observable<ServiceResponse<HybridConnectionInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String hybridConnectionName, HybridConnectionInner parameters) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (namespaceName == null) {
        throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
    }
    if (hybridConnectionName == null) {
        throw new IllegalArgumentException("Parameter hybridConnectionName 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 (parameters == null) {
        throw new IllegalArgumentException("Parameter parameters 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(parameters);
    return service.createOrUpdate(resourceGroupName, namespaceName, hybridConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<HybridConnectionInner>>>() {
            @Override
            public Observable<ServiceResponse<HybridConnectionInner>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<HybridConnectionInner> clientResponse = createOrUpdateDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:autorest.java    文件:ExplicitsImpl.java   
/**
 * Test explicitly optional integer. Please put a header 'headerParameter' =&gt; null.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponse} object if successful.
 */
public Observable<Void> postOptionalArrayHeaderAsync() {
    return postOptionalArrayHeaderWithServiceResponseAsync().map(new Func1<ServiceResponse<Void>, Void>() {
        @Override
        public Void call(ServiceResponse<Void> response) {
            return response.body();
        }
    });
}
项目:autorest.java    文件:LROSADsInner.java   
/**
 * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponseWithHeaders} object if successful.
 */
public Observable<Void> beginPost202RetryInvalidHeaderAsync() {
    return beginPost202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1<ServiceResponseWithHeaders<Void, LROSADsPost202RetryInvalidHeaderHeadersInner>, Void>() {
        @Override
        public Void call(ServiceResponseWithHeaders<Void, LROSADsPost202RetryInvalidHeaderHeadersInner> response) {
            return response.body();
        }
    });
}
项目:autorest.java    文件:HeadersImpl.java   
/**
 * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT".
 *
 * @param scenario Send a post request with header values "scenario": "valid" or "min"
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponseWithHeaders} object if successful.
 */
public Observable<Void> responseDatetimeRfc1123Async(String scenario) {
    return responseDatetimeRfc1123WithServiceResponseAsync(scenario).map(new Func1<ServiceResponseWithHeaders<Void, HeaderResponseDatetimeRfc1123Headers>, Void>() {
        @Override
        public Void call(ServiceResponseWithHeaders<Void, HeaderResponseDatetimeRfc1123Headers> response) {
            return response.body();
        }
    });
}
项目:azure-libraries-for-java    文件:ReplicationsInner.java   
/**
 * Lists all the replications for the specified container registry.
 *
ServiceResponse<PageImpl<ReplicationInner>> * @param resourceGroupName The name of the resource group to which the container registry belongs.
ServiceResponse<PageImpl<ReplicationInner>> * @param registryName The name of the container registry.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;ReplicationInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<ReplicationInner>>> listSinglePageAsync(final String resourceGroupName, final String registryName) {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (registryName == null) {
        throw new IllegalArgumentException("Parameter registryName 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(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ReplicationInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<ReplicationInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<ReplicationInner>> result = listDelegate(response);
                    return Observable.just(new ServiceResponse<Page<ReplicationInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:WebAppsInner.java   
/**
 * Gets existing backups of an app.
 * Gets existing backups of an app.
 *
 * @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;BackupItemInner&gt; object
 */
public Observable<Page<BackupItemInner>> listBackupsSlotNextAsync(final String nextPageLink) {
    return listBackupsSlotNextWithServiceResponseAsync(nextPageLink)
        .map(new Func1<ServiceResponse<Page<BackupItemInner>>, Page<BackupItemInner>>() {
            @Override
            public Page<BackupItemInner> call(ServiceResponse<Page<BackupItemInner>> response) {
                return response.body();
            }
        });
}
项目:azure-libraries-for-java    文件:ArtifactSourcesInner.java   
/**
 * Get artifact source.
 *
 * @param resourceGroupName The name of the resource group.
 * @param labName The name of the lab.
 * @param name The name of the artifact source.
 * @param expand Specify the $expand query. Example: 'properties($select=displayName)'
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the ArtifactSourceInner object
 */
public Observable<ServiceResponse<ArtifactSourceInner>> getWithServiceResponseAsync(String resourceGroupName, String labName, String name, String expand) {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (labName == null) {
        throw new IllegalArgumentException("Parameter labName is required and cannot be null.");
    }
    if (name == null) {
        throw new IllegalArgumentException("Parameter name 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(this.client.subscriptionId(), resourceGroupName, labName, name, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ArtifactSourceInner>>>() {
            @Override
            public Observable<ServiceResponse<ArtifactSourceInner>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<ArtifactSourceInner> clientResponse = getDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:autorest.java    文件:HeadersInner.java   
/**
 * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group.
 *
 * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponseWithHeaders} object if successful.
 */
public Observable<Void> customNamedRequestIdParamGroupingAsync(HeaderCustomNamedRequestIdParamGroupingParametersInner headerCustomNamedRequestIdParamGroupingParameters) {
    return customNamedRequestIdParamGroupingWithServiceResponseAsync(headerCustomNamedRequestIdParamGroupingParameters).map(new Func1<ServiceResponseWithHeaders<Void, HeaderCustomNamedRequestIdParamGroupingHeadersInner>, Void>() {
        @Override
        public Void call(ServiceResponseWithHeaders<Void, HeaderCustomNamedRequestIdParamGroupingHeadersInner> response) {
            return response.body();
        }
    });
}
项目:azure-libraries-for-java    文件:WorkflowTriggerHistoriesInner.java   
/**
 * Gets a list of workflow trigger histories.
 *
 * @param resourceGroupName The resource group name.
 * @param workflowName The workflow name.
 * @param triggerName The workflow trigger name.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;WorkflowTriggerHistoryInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<WorkflowTriggerHistoryInner>>> listSinglePageAsync(final String resourceGroupName, final String workflowName, final String triggerName) {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (workflowName == null) {
        throw new IllegalArgumentException("Parameter workflowName is required and cannot be null.");
    }
    if (triggerName == null) {
        throw new IllegalArgumentException("Parameter triggerName is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    final Integer top = null;
    final String filter = null;
    return service.list(this.client.subscriptionId(), resourceGroupName, workflowName, triggerName, this.client.apiVersion(), top, filter, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<WorkflowTriggerHistoryInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<WorkflowTriggerHistoryInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<WorkflowTriggerHistoryInner>> result = listDelegate(response);
                    return Observable.just(new ServiceResponse<Page<WorkflowTriggerHistoryInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:healthvault-java-sdk    文件:MicrosoftHealthVaultRestApiImpl.java   
/**
 * Delete a task by id.
 *
 * @param actionPlanTaskId the String value
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the Object object
 */
public Observable<Object> deleteActionPlanTaskByIdAsync(String actionPlanTaskId) {
    return deleteActionPlanTaskByIdWithServiceResponseAsync(actionPlanTaskId).map(new Func1<ServiceResponse<Object>, Object>() {
        @Override
        public Object call(ServiceResponse<Object> response) {
            return response.body();
        }
    });
}
项目:azure-libraries-for-java    文件:CatalogsImpl.java   
/**
 * Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog.
 *
 * @param accountName The Azure Data Lake Analytics account upon which to execute catalog operations.
 * @param databaseName The name of the database containing the types.
 * @param schemaName The name of the schema containing the types.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;USqlType&gt; object
 */
public Observable<ServiceResponse<Page<USqlType>>> listTypesWithServiceResponseAsync(final String accountName, final String databaseName, final String schemaName) {
    return listTypesSinglePageAsync(accountName, databaseName, schemaName)
        .concatMap(new Func1<ServiceResponse<Page<USqlType>>, Observable<ServiceResponse<Page<USqlType>>>>() {
            @Override
            public Observable<ServiceResponse<Page<USqlType>>> call(ServiceResponse<Page<USqlType>> page) {
                String nextPageLink = page.body().nextPageLink();
                if (nextPageLink == null) {
                    return Observable.just(page);
                }
                return Observable.just(page).concatWith(listTypesNextWithServiceResponseAsync(nextPageLink));
            }
        });
}
项目:azure-libraries-for-java    文件:AppServiceCertificateOrdersInner.java   
/**
 * Creates or updates a certificate and associates with key vault secret.
 * Creates or updates a certificate and associates with key vault secret.
 *
 * @param resourceGroupName Name of the resource group to which the resource belongs.
 * @param certificateOrderName Name of the certificate order.
 * @param name Name of the certificate.
 * @param keyVaultCertificate Key vault certificate resource Id.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the AppServiceCertificateResourceInner object
 */
public Observable<ServiceResponse<AppServiceCertificateResourceInner>> beginCreateOrUpdateCertificateWithServiceResponseAsync(String resourceGroupName, String certificateOrderName, String name, AppServiceCertificateResourceInner keyVaultCertificate) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (certificateOrderName == null) {
        throw new IllegalArgumentException("Parameter certificateOrderName 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 (keyVaultCertificate == null) {
        throw new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.");
    }
    Validator.validate(keyVaultCertificate);
    final String apiVersion = "2015-08-01";
    return service.beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName, name, this.client.subscriptionId(), keyVaultCertificate, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<AppServiceCertificateResourceInner>>>() {
            @Override
            public Observable<ServiceResponse<AppServiceCertificateResourceInner>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<AppServiceCertificateResourceInner> clientResponse = beginCreateOrUpdateCertificateDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:autorest.java    文件:PagingsImpl.java   
/**
 * A paging operation that includes a nextLink in odata format that has 10 pages.
 *
 * @param clientRequestId the String value
 * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
 * @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<Product>> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions, final ListOperationCallback<Product> serviceCallback) {
    return AzureServiceFuture.fromPageResponse(
        getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions),
        new Func1<String, Observable<ServiceResponse<Page<Product>>>>() {
            @Override
            public Observable<ServiceResponse<Page<Product>>> call(String nextPageLink) {
                return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions);
            }
        },
        serviceCallback);
}
项目:azure-libraries-for-java    文件:TopLevelDomainsInner.java   
/**
 * Get all top-level domains supported for registration.
 * Get all top-level domains supported for registration.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;TopLevelDomainInner&gt; object
 */
public Observable<Page<TopLevelDomainInner>> listAsync() {
    return listWithServiceResponseAsync()
        .map(new Func1<ServiceResponse<Page<TopLevelDomainInner>>, Page<TopLevelDomainInner>>() {
            @Override
            public Page<TopLevelDomainInner> call(ServiceResponse<Page<TopLevelDomainInner>> response) {
                return response.body();
            }
        });
}
项目:autorest.java    文件:LROsInner.java   
/**
 * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceResponseWithHeaders} object if successful.
 */
public Observable<Void> beginDeleteAsyncRetrySucceededAsync() {
    return beginDeleteAsyncRetrySucceededWithServiceResponseAsync().map(new Func1<ServiceResponseWithHeaders<Void, LROsDeleteAsyncRetrySucceededHeadersInner>, Void>() {
        @Override
        public Void call(ServiceResponseWithHeaders<Void, LROsDeleteAsyncRetrySucceededHeadersInner> response) {
            return response.body();
        }
    });
}
项目:azure-libraries-for-java    文件:ActiveDirectoryApplicationsImpl.java   
@Override
public Observable<ActiveDirectoryApplication> listAsync() {
    return wrapPageAsync(this.inner().listAsync())
            .flatMap(new Func1<ActiveDirectoryApplication, Observable<ActiveDirectoryApplication>>() {
                @Override
                public Observable<ActiveDirectoryApplication> call(ActiveDirectoryApplication application) {
                    return ((ActiveDirectoryApplicationImpl) application).refreshCredentialsAsync();
                }
            });
}
项目:azure-libraries-for-java    文件:InputsInner.java   
/**
 * Lists all of the inputs under the specified streaming job.
 *
 * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
 * @param jobName The name of the streaming job.
 * @param select The $select OData query parameter. This is a comma-separated list of structural properties to include in the response, or “*” to include all properties. By default, all properties are returned except diagnostics. Currently only accepts '*' as a valid value.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;InputInner&gt; object
 */
public Observable<Page<InputInner>> listByStreamingJobAsync(final String resourceGroupName, final String jobName, final String select) {
    return listByStreamingJobWithServiceResponseAsync(resourceGroupName, jobName, select)
        .map(new Func1<ServiceResponse<Page<InputInner>>, Page<InputInner>>() {
            @Override
            public Page<InputInner> call(ServiceResponse<Page<InputInner>> response) {
                return response.body();
            }
        });
}
项目:azure-libraries-for-java    文件:WebAppsInner.java   
/**
 * Gets a triggered web job by its ID for an app, or a deployment slot.
 * Gets a triggered web job by its ID for an app, or a deployment slot.
 *
 * @param resourceGroupName Name of the resource group to which the resource belongs.
 * @param name Site name.
 * @param webJobName Name of Web Job.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the TriggeredWebJobInner object
 */
public Observable<ServiceResponse<TriggeredWebJobInner>> getTriggeredWebJobWithServiceResponseAsync(String resourceGroupName, String name, String webJobName) {
    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 (webJobName == null) {
        throw new IllegalArgumentException("Parameter webJobName is required and cannot be null.");
    }
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    final String apiVersion = "2016-08-01";
    return service.getTriggeredWebJob(resourceGroupName, name, webJobName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TriggeredWebJobInner>>>() {
            @Override
            public Observable<ServiceResponse<TriggeredWebJobInner>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<TriggeredWebJobInner> clientResponse = getTriggeredWebJobDelegate(response);
                    return Observable.just(clientResponse);
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
项目:azure-libraries-for-java    文件:AvailabilitySetsInner.java   
/**
 * Delete an availability set.
 *
 * @param resourceGroupName The name of the resource group.
 * @param availabilitySetName The name of the availability set.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the OperationStatusResponseInner object
 */
public Observable<OperationStatusResponseInner> deleteAsync(String resourceGroupName, String availabilitySetName) {
    return deleteWithServiceResponseAsync(resourceGroupName, availabilitySetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
        @Override
        public OperationStatusResponseInner call(ServiceResponse<OperationStatusResponseInner> response) {
            return response.body();
        }
    });
}
项目:azure-libraries-for-java    文件:KpisInner.java   
/**
 * Gets all the KPIs in the specified hub.
 *
 * @param resourceGroupName The name of the resource group.
 * @param hubName The name of the hub.
 * @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<KpiResourceFormatInner>> listByHubAsync(final String resourceGroupName, final String hubName, final ListOperationCallback<KpiResourceFormatInner> serviceCallback) {
    return AzureServiceFuture.fromPageResponse(
        listByHubSinglePageAsync(resourceGroupName, hubName),
        new Func1<String, Observable<ServiceResponse<Page<KpiResourceFormatInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<KpiResourceFormatInner>>> call(String nextPageLink) {
                return listByHubNextSinglePageAsync(nextPageLink);
            }
        },
        serviceCallback);
}