本文整理汇总了Java中com.microsoft.rest.ServiceResponse类的典型用法代码示例。如果您正苦于以下问题:Java ServiceResponse类的具体用法?Java ServiceResponse怎么用?Java ServiceResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceResponse类属于com.microsoft.rest包,在下文中一共展示了ServiceResponse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listNextSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Lists all jobs under the specified job collection.
*
ServiceResponse<PageImpl<JobDefinitionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<JobDefinitionInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<JobDefinitionInner>>>>() {
@Override
public Observable<ServiceResponse<Page<JobDefinitionInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<JobDefinitionInner>> result = listNextDelegate(response);
return Observable.just(new ServiceResponse<Page<JobDefinitionInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例2: testWithServiceResponseAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Tests whether an input’s datasource is reachable and usable by the Azure Stream Analytics service.
*
* @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 inputName The name of the input.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<ResourceTestStatusInner>> testWithServiceResponseAsync(String resourceGroupName, String jobName, String inputName) {
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.");
}
if (inputName == null) {
throw new IllegalArgumentException("Parameter inputName is required and cannot be null.");
}
final String apiVersion = "2016-03-01";
final InputInner input = null;
Observable<Response<ResponseBody>> observable = service.test(this.client.subscriptionId(), resourceGroupName, jobName, inputName, input, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<ResourceTestStatusInner>() { }.getType());
}
示例3: listNextSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Get all domains in a subscription.
* Get all domains in a subscription.
*
ServiceResponse<PageImpl<DomainInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<DomainInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DomainInner>>>>() {
@Override
public Observable<ServiceResponse<Page<DomainInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<DomainInner>> result = listNextDelegate(response);
return Observable.just(new ServiceResponse<Page<DomainInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例4: beginGetLearnedRoutesWithServiceResponseAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkGatewayName The name of the virtual network gateway.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the GatewayRouteListResultInner object
*/
public Observable<ServiceResponse<GatewayRouteListResultInner>> beginGetLearnedRoutesWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (virtualNetworkGatewayName == null) {
throw new IllegalArgumentException("Parameter virtualNetworkGatewayName 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 = "2017-08-01";
return service.beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<GatewayRouteListResultInner>>>() {
@Override
public Observable<ServiceResponse<GatewayRouteListResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<GatewayRouteListResultInner> clientResponse = beginGetLearnedRoutesDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例5: getByResourceGroupWithServiceResponseAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Gets the specified virtual network gateway connection by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the VirtualNetworkGatewayConnectionInner object
*/
public Observable<ServiceResponse<VirtualNetworkGatewayConnectionInner>> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (virtualNetworkGatewayConnectionName == null) {
throw new IllegalArgumentException("Parameter virtualNetworkGatewayConnectionName 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 = "2017-08-01";
return service.getByResourceGroup(resourceGroupName, virtualNetworkGatewayConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<VirtualNetworkGatewayConnectionInner>>>() {
@Override
public Observable<ServiceResponse<VirtualNetworkGatewayConnectionInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<VirtualNetworkGatewayConnectionInner> clientResponse = getByResourceGroupDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例6: listByResourceGroupNextSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Get all App Service plans in a resource group.
* Get all App Service plans in a resource group.
*
ServiceResponse<PageImpl<AppServicePlanInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<AppServicePlanInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<AppServicePlanInner>>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<AppServicePlanInner>>>>() {
@Override
public Observable<ServiceResponse<Page<AppServicePlanInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<AppServicePlanInner>> result = listByResourceGroupNextDelegate(response);
return Observable.just(new ServiceResponse<Page<AppServicePlanInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例7: listSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Get all deleted apps for a subscription.
* Get all deleted apps for a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DeletedSiteInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<DeletedSiteInner>>> listSinglePageAsync() {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2016-03-01";
return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DeletedSiteInner>>>>() {
@Override
public Observable<ServiceResponse<Page<DeletedSiteInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<DeletedSiteInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<DeletedSiteInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例8: dateValidWithServiceResponseAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Get '2012-01-01' as date.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> dateValidWithServiceResponseAsync() {
final LocalDate datePath = LocalDate.parse("2012-01-01");
return service.dateValid(datePath)
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = dateValidDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例9: listAllNextSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
*
ServiceResponse<PageImpl<ConsumerGroupResourceInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ConsumerGroupResourceInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ConsumerGroupResourceInner>>> listAllNextSinglePageAsync(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.listAllNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ConsumerGroupResourceInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ConsumerGroupResourceInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ConsumerGroupResourceInner>> result = listAllNextDelegate(response);
return Observable.just(new ServiceResponse<Page<ConsumerGroupResourceInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例10: listSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Gets a list of managed clusters in the specified subscription.
* Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ManagedClusterInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ManagedClusterInner>>> listSinglePageAsync() {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2017-08-31";
return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ManagedClusterInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ManagedClusterInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ManagedClusterInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<ManagedClusterInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例11: getByResourceGroupWithServiceResponseAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Gets the specified network security group.
*
* @param resourceGroupName The name of the resource group.
* @param networkSecurityGroupName The name of the network security group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkSecurityGroupInner object
*/
public Observable<ServiceResponse<NetworkSecurityGroupInner>> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkSecurityGroupName == null) {
throw new IllegalArgumentException("Parameter networkSecurityGroupName 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 = "2017-08-01";
final String expand = null;
return service.getByResourceGroup(resourceGroupName, networkSecurityGroupName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<NetworkSecurityGroupInner>>>() {
@Override
public Observable<ServiceResponse<NetworkSecurityGroupInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<NetworkSecurityGroupInner> clientResponse = getByResourceGroupDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例12: listSiteDiagnosticCategoriesNextSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Get Diagnostics Categories.
* Get Diagnostics Categories.
*
ServiceResponse<PageImpl<DiagnosticCategoryInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DiagnosticCategoryInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<DiagnosticCategoryInner>>> listSiteDiagnosticCategoriesNextSinglePageAsync(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.listSiteDiagnosticCategoriesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DiagnosticCategoryInner>>>>() {
@Override
public Observable<ServiceResponse<Page<DiagnosticCategoryInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<DiagnosticCategoryInner>> result = listSiteDiagnosticCategoriesNextDelegate(response);
return Observable.just(new ServiceResponse<Page<DiagnosticCategoryInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例13: deleteGoalWithServiceResponseAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Delete a goal instance.
*
* @param goalId The identifier of the goal to delete.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the Object object
*/
public Observable<ServiceResponse<Object>> deleteGoalWithServiceResponseAsync(String goalId) {
if (goalId == null) {
throw new IllegalArgumentException("Parameter goalId is required and cannot be null.");
}
return service.deleteGoal(goalId)
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Object>>>() {
@Override
public Observable<ServiceResponse<Object>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Object> clientResponse = deleteGoalDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例14: listNextSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription.
*
ServiceResponse<PageImpl1<UsageInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<UsageInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<UsageInner>>>>() {
@Override
public Observable<ServiceResponse<Page<UsageInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl1<UsageInner>> result = listNextDelegate(response);
return Observable.just(new ServiceResponse<Page<UsageInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
示例15: listTableStatisticsByDatabaseNextSinglePageAsync
import com.microsoft.rest.ServiceResponse; //导入依赖的package包/类
/**
* Retrieves the list of all statistics in a database from the Data Lake Analytics catalog.
*
ServiceResponse<PageImpl<USqlTableStatistics>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<USqlTableStatistics> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<USqlTableStatistics>>> listTableStatisticsByDatabaseNextSinglePageAsync(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.listTableStatisticsByDatabaseNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<USqlTableStatistics>>>>() {
@Override
public Observable<ServiceResponse<Page<USqlTableStatistics>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<USqlTableStatistics>> result = listTableStatisticsByDatabaseNextDelegate(response);
return Observable.just(new ServiceResponse<Page<USqlTableStatistics>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}