com.microsoft.azure.management.resources.implementation.DeploymentOperationsInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-mgmt-resources Show documentation
Show all versions of azure-mgmt-resources Show documentation
This package contains Microsoft Azure Resource Management SDK.
/**
* 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.resources.implementation;
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.AzureServiceFuture;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.ListOperationCallback;
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 java.io.IOException;
import java.util.List;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Path;
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 DeploymentOperations.
*/
public class DeploymentOperationsInner {
/** The Retrofit service to perform REST calls. */
private DeploymentOperationsService service;
/** The service client containing this operation class. */
private ResourceManagementClientImpl client;
/**
* Initializes an instance of DeploymentOperationsInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public DeploymentOperationsInner(Retrofit retrofit, ResourceManagementClientImpl client) {
this.service = retrofit.create(DeploymentOperationsService.class);
this.client = client;
}
/**
* The interface defining all the services for DeploymentOperations to be
* used by Retrofit to perform actually REST calls.
*/
interface DeploymentOperationsService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.DeploymentOperations getAtScope" })
@GET("{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}")
Observable> getAtScope(@Path(value = "scope", encoded = true) String scope, @Path("deploymentName") String deploymentName, @Path("operationId") String operationId, @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.resources.DeploymentOperations listAtScope" })
@GET("{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations")
Observable> listAtScope(@Path(value = "scope", encoded = true) String scope, @Path("deploymentName") String deploymentName, @Query("$top") Integer top, @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.resources.DeploymentOperations getAtTenantScope" })
@GET("providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}")
Observable> getAtTenantScope(@Path("deploymentName") String deploymentName, @Path("operationId") String operationId, @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.resources.DeploymentOperations listAtTenantScope" })
@GET("providers/Microsoft.Resources/deployments/{deploymentName}/operations")
Observable> listAtTenantScope(@Path("deploymentName") String deploymentName, @Query("$top") Integer top, @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.resources.DeploymentOperations getAtManagementGroupScope" })
@GET("providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}")
Observable> getAtManagementGroupScope(@Path("groupId") String groupId, @Path("deploymentName") String deploymentName, @Path("operationId") String operationId, @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.resources.DeploymentOperations listAtManagementGroupScope" })
@GET("providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations")
Observable> listAtManagementGroupScope(@Path("groupId") String groupId, @Path("deploymentName") String deploymentName, @Query("$top") Integer top, @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.resources.DeploymentOperations getAtSubscriptionScope" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}")
Observable> getAtSubscriptionScope(@Path("deploymentName") String deploymentName, @Path("operationId") String operationId, @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.resources.DeploymentOperations listAtSubscriptionScope" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations")
Observable> listAtSubscriptionScope(@Path("deploymentName") String deploymentName, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @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.resources.DeploymentOperations get" })
@GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}")
Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("deploymentName") String deploymentName, @Path("operationId") String operationId, @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.resources.DeploymentOperations listByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations")
Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("deploymentName") String deploymentName, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @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.resources.DeploymentOperations listAtScopeNext" })
@GET
Observable> listAtScopeNext(@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.resources.DeploymentOperations listAtTenantScopeNext" })
@GET
Observable> listAtTenantScopeNext(@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.resources.DeploymentOperations listAtManagementGroupScopeNext" })
@GET
Observable> listAtManagementGroupScopeNext(@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.resources.DeploymentOperations listAtSubscriptionScopeNext" })
@GET
Observable> listAtSubscriptionScopeNext(@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.resources.DeploymentOperations listByResourceGroupNext" })
@GET
Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
/**
* Gets a deployments operation.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the DeploymentOperationInner object if successful.
*/
public DeploymentOperationInner getAtScope(String scope, String deploymentName, String operationId) {
return getAtScopeWithServiceResponseAsync(scope, deploymentName, operationId).toBlocking().single().body();
}
/**
* Gets a deployments operation.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @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 getAtScopeAsync(String scope, String deploymentName, String operationId, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getAtScopeWithServiceResponseAsync(scope, deploymentName, operationId), serviceCallback);
}
/**
* Gets a deployments operation.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentOperationInner object
*/
public Observable getAtScopeAsync(String scope, String deploymentName, String operationId) {
return getAtScopeWithServiceResponseAsync(scope, deploymentName, operationId).map(new Func1, DeploymentOperationInner>() {
@Override
public DeploymentOperationInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets a deployments operation.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentOperationInner object
*/
public Observable> getAtScopeWithServiceResponseAsync(String scope, String deploymentName, String operationId) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
}
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null.");
}
if (operationId == null) {
throw new IllegalArgumentException("Parameter operationId 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.getAtScope(scope, deploymentName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getAtScopeDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getAtScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException 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<DeploymentOperationInner> object if successful.
*/
public PagedList listAtScope(final String scope, final String deploymentName) {
ServiceResponse> response = listAtScopeSinglePageAsync(scope, deploymentName).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listAtScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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> listAtScopeAsync(final String scope, final String deploymentName, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAtScopeSinglePageAsync(scope, deploymentName),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listAtScopeNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable> listAtScopeAsync(final String scope, final String deploymentName) {
return listAtScopeWithServiceResponseAsync(scope, deploymentName)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable>> listAtScopeWithServiceResponseAsync(final String scope, final String deploymentName) {
return listAtScopeSinglePageAsync(scope, deploymentName)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAtScopeNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listAtScopeSinglePageAsync(final String scope, final String deploymentName) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
}
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName 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;
return service.listAtScope(scope, deploymentName, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listAtScopeDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException 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<DeploymentOperationInner> object if successful.
*/
public PagedList listAtScope(final String scope, final String deploymentName, final Integer top) {
ServiceResponse> response = listAtScopeSinglePageAsync(scope, deploymentName, top).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listAtScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @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> listAtScopeAsync(final String scope, final String deploymentName, final Integer top, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAtScopeSinglePageAsync(scope, deploymentName, top),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listAtScopeNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable> listAtScopeAsync(final String scope, final String deploymentName, final Integer top) {
return listAtScopeWithServiceResponseAsync(scope, deploymentName, top)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable>> listAtScopeWithServiceResponseAsync(final String scope, final String deploymentName, final Integer top) {
return listAtScopeSinglePageAsync(scope, deploymentName, top)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAtScopeNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all deployments operations for a deployment.
*
ServiceResponse> * @param scope The resource scope.
ServiceResponse> * @param deploymentName The name of the deployment.
ServiceResponse> * @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listAtScopeSinglePageAsync(final String scope, final String deploymentName, final Integer top) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
}
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName 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.listAtScope(scope, deploymentName, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listAtScopeDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse> listAtScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets a deployments operation.
*
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the DeploymentOperationInner object if successful.
*/
public DeploymentOperationInner getAtTenantScope(String deploymentName, String operationId) {
return getAtTenantScopeWithServiceResponseAsync(deploymentName, operationId).toBlocking().single().body();
}
/**
* Gets a deployments operation.
*
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @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 getAtTenantScopeAsync(String deploymentName, String operationId, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getAtTenantScopeWithServiceResponseAsync(deploymentName, operationId), serviceCallback);
}
/**
* Gets a deployments operation.
*
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentOperationInner object
*/
public Observable getAtTenantScopeAsync(String deploymentName, String operationId) {
return getAtTenantScopeWithServiceResponseAsync(deploymentName, operationId).map(new Func1, DeploymentOperationInner>() {
@Override
public DeploymentOperationInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets a deployments operation.
*
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentOperationInner object
*/
public Observable> getAtTenantScopeWithServiceResponseAsync(String deploymentName, String operationId) {
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null.");
}
if (operationId == null) {
throw new IllegalArgumentException("Parameter operationId 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.getAtTenantScope(deploymentName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getAtTenantScopeDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getAtTenantScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException 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<DeploymentOperationInner> object if successful.
*/
public PagedList listAtTenantScope(final String deploymentName) {
ServiceResponse> response = listAtTenantScopeSinglePageAsync(deploymentName).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listAtTenantScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @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> listAtTenantScopeAsync(final String deploymentName, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAtTenantScopeSinglePageAsync(deploymentName),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listAtTenantScopeNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable> listAtTenantScopeAsync(final String deploymentName) {
return listAtTenantScopeWithServiceResponseAsync(deploymentName)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable>> listAtTenantScopeWithServiceResponseAsync(final String deploymentName) {
return listAtTenantScopeSinglePageAsync(deploymentName)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAtTenantScopeNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listAtTenantScopeSinglePageAsync(final String deploymentName) {
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName 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;
return service.listAtTenantScope(deploymentName, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listAtTenantScopeDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException 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<DeploymentOperationInner> object if successful.
*/
public PagedList listAtTenantScope(final String deploymentName, final Integer top) {
ServiceResponse> response = listAtTenantScopeSinglePageAsync(deploymentName, top).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listAtTenantScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @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> listAtTenantScopeAsync(final String deploymentName, final Integer top, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAtTenantScopeSinglePageAsync(deploymentName, top),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listAtTenantScopeNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable> listAtTenantScopeAsync(final String deploymentName, final Integer top) {
return listAtTenantScopeWithServiceResponseAsync(deploymentName, top)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable>> listAtTenantScopeWithServiceResponseAsync(final String deploymentName, final Integer top) {
return listAtTenantScopeSinglePageAsync(deploymentName, top)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAtTenantScopeNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all deployments operations for a deployment.
*
ServiceResponse> * @param deploymentName The name of the deployment.
ServiceResponse> * @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listAtTenantScopeSinglePageAsync(final String deploymentName, final Integer top) {
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName 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.listAtTenantScope(deploymentName, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listAtTenantScopeDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse> listAtTenantScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets a deployments operation.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the DeploymentOperationInner object if successful.
*/
public DeploymentOperationInner getAtManagementGroupScope(String groupId, String deploymentName, String operationId) {
return getAtManagementGroupScopeWithServiceResponseAsync(groupId, deploymentName, operationId).toBlocking().single().body();
}
/**
* Gets a deployments operation.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @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 getAtManagementGroupScopeAsync(String groupId, String deploymentName, String operationId, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getAtManagementGroupScopeWithServiceResponseAsync(groupId, deploymentName, operationId), serviceCallback);
}
/**
* Gets a deployments operation.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentOperationInner object
*/
public Observable getAtManagementGroupScopeAsync(String groupId, String deploymentName, String operationId) {
return getAtManagementGroupScopeWithServiceResponseAsync(groupId, deploymentName, operationId).map(new Func1, DeploymentOperationInner>() {
@Override
public DeploymentOperationInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets a deployments operation.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentOperationInner object
*/
public Observable> getAtManagementGroupScopeWithServiceResponseAsync(String groupId, String deploymentName, String operationId) {
if (groupId == null) {
throw new IllegalArgumentException("Parameter groupId is required and cannot be null.");
}
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null.");
}
if (operationId == null) {
throw new IllegalArgumentException("Parameter operationId 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.getAtManagementGroupScope(groupId, deploymentName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getAtManagementGroupScopeDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getAtManagementGroupScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException 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<DeploymentOperationInner> object if successful.
*/
public PagedList listAtManagementGroupScope(final String groupId, final String deploymentName) {
ServiceResponse> response = listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listAtManagementGroupScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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> listAtManagementGroupScopeAsync(final String groupId, final String deploymentName, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listAtManagementGroupScopeNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable> listAtManagementGroupScopeAsync(final String groupId, final String deploymentName) {
return listAtManagementGroupScopeWithServiceResponseAsync(groupId, deploymentName)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable>> listAtManagementGroupScopeWithServiceResponseAsync(final String groupId, final String deploymentName) {
return listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAtManagementGroupScopeNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listAtManagementGroupScopeSinglePageAsync(final String groupId, final String deploymentName) {
if (groupId == null) {
throw new IllegalArgumentException("Parameter groupId is required and cannot be null.");
}
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName 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;
return service.listAtManagementGroupScope(groupId, deploymentName, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listAtManagementGroupScopeDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException 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<DeploymentOperationInner> object if successful.
*/
public PagedList listAtManagementGroupScope(final String groupId, final String deploymentName, final Integer top) {
ServiceResponse> response = listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listAtManagementGroupScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @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> listAtManagementGroupScopeAsync(final String groupId, final String deploymentName, final Integer top, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listAtManagementGroupScopeNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable> listAtManagementGroupScopeAsync(final String groupId, final String deploymentName, final Integer top) {
return listAtManagementGroupScopeWithServiceResponseAsync(groupId, deploymentName, top)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all deployments operations for a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DeploymentOperationInner> object
*/
public Observable>> listAtManagementGroupScopeWithServiceResponseAsync(final String groupId, final String deploymentName, final Integer top) {
return listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listAtManagementGroupScopeNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all deployments operations for a deployment.
*
ServiceResponse> * @param groupId The management group ID.
ServiceResponse> * @param deploymentName The name of the deployment.
ServiceResponse> * @param top The number of results to return.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listAtManagementGroupScopeSinglePageAsync(final String groupId, final String deploymentName, final Integer top) {
if (groupId == null) {
throw new IllegalArgumentException("Parameter groupId is required and cannot be null.");
}
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName 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.listAtManagementGroupScope(groupId, deploymentName, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listAtManagementGroupScopeDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse> listAtManagementGroupScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets a deployments operation.
*
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the DeploymentOperationInner object if successful.
*/
public DeploymentOperationInner getAtSubscriptionScope(String deploymentName, String operationId) {
return getAtSubscriptionScopeWithServiceResponseAsync(deploymentName, operationId).toBlocking().single().body();
}
/**
* Gets a deployments operation.
*
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @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 getAtSubscriptionScopeAsync(String deploymentName, String operationId, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getAtSubscriptionScopeWithServiceResponseAsync(deploymentName, operationId), serviceCallback);
}
/**
* Gets a deployments operation.
*
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentOperationInner object
*/
public Observable getAtSubscriptionScopeAsync(String deploymentName, String operationId) {
return getAtSubscriptionScopeWithServiceResponseAsync(deploymentName, operationId).map(new Func1, DeploymentOperationInner>() {
@Override
public DeploymentOperationInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets a deployments operation.
*
* @param deploymentName The name of the deployment.
* @param operationId The ID of the operation to get.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DeploymentOperationInner object
*/
public Observable> getAtSubscriptionScopeWithServiceResponseAsync(String deploymentName, String operationId) {
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null.");
}
if (operationId == null) {
throw new IllegalArgumentException("Parameter operationId 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.getAtSubscriptionScope(deploymentName, operationId, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getAtSubscriptionScopeDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getAtSubscriptionScopeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException 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<DeploymentOperationInner> object if successful.
*/
public PagedList listAtSubscriptionScope(final String deploymentName) {
ServiceResponse> response = listAtSubscriptionScopeSinglePageAsync(deploymentName).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listAtSubscriptionScopeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all deployments operations for a deployment.
*
* @param deploymentName The name of the deployment.
* @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> listAtSubscriptionScopeAsync(final String deploymentName, final ListOperationCallback