Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
Code generated by Microsoft (R) AutoRest Code Generator.
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.batchai.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.management.batchai.ExperimentsListByWorkspaceOptions;
import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.Validator;
import java.io.IOException;
import java.util.List;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.HTTP;
import retrofit2.http.Path;
import retrofit2.http.PUT;
import retrofit2.http.Query;
import retrofit2.http.Url;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;
An instance of this class provides access to all the operations defined
in Experiments.
/**
* An instance of this class provides access to all the operations defined
* in Experiments.
*/
public class ExperimentsInner {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private ExperimentsService service;
The service client containing this operation class. /** The service client containing this operation class. */
private BatchAIManagementClientImpl client;
Initializes an instance of ExperimentsInner.
Params: - retrofit – the Retrofit instance built from a Retrofit Builder.
- client – the instance of the service client containing this operation class.
/**
* Initializes an instance of ExperimentsInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public ExperimentsInner(Retrofit retrofit, BatchAIManagementClientImpl client) {
this.service = retrofit.create(ExperimentsService.class);
this.client = client;
}
The interface defining all the services for Experiments to be
used by Retrofit to perform actually REST calls.
/**
* The interface defining all the services for Experiments to be
* used by Retrofit to perform actually REST calls.
*/
interface ExperimentsService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batchai.Experiments listByWorkspace" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments")
Observable<Response<ResponseBody>> listByWorkspace(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("maxresults") Integer maxResults, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batchai.Experiments create" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}")
Observable<Response<ResponseBody>> create(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("experimentName") String experimentName, @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.batchai.Experiments beginCreate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}")
Observable<Response<ResponseBody>> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("experimentName") String experimentName, @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.batchai.Experiments delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("experimentName") String experimentName, @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.batchai.Experiments beginDelete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("experimentName") String experimentName, @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.batchai.Experiments get" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}")
Observable<Response<ResponseBody>> get(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("experimentName") String experimentName, @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.batchai.Experiments listByWorkspaceNext" })
@GET
Observable<Response<ResponseBody>> listByWorkspaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<ExperimentInner> object if successful.
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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<ExperimentInner> object if successful.
*/
public PagedList<ExperimentInner> listByWorkspace(final String resourceGroupName, final String workspaceName) {
ServiceResponse<Page<ExperimentInner>> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName).toBlocking().single();
return new PagedList<ExperimentInner>(response.body()) {
@Override
public Page<ExperimentInner> nextPage(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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<ExperimentInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ListOperationCallback<ExperimentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName),
new Func1<String, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ExperimentInner> object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ExperimentInner> object
*/
public Observable<Page<ExperimentInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) {
return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName)
.map(new Func1<ServiceResponse<Page<ExperimentInner>>, Page<ExperimentInner>>() {
@Override
public Page<ExperimentInner> call(ServiceResponse<Page<ExperimentInner>> response) {
return response.body();
}
});
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ExperimentInner> object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ExperimentInner> object
*/
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName) {
return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)
.concatMap(new Func1<ServiceResponse<Page<ExperimentInner>>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(ServiceResponse<Page<ExperimentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<ExperimentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ExperimentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (workspaceName == null) {
throw new IllegalArgumentException("Parameter workspaceName 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.");
}
final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions = null;
Integer maxResults = null;
return service.listByWorkspace(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), maxResults, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ExperimentInner>> result = listByWorkspaceDelegate(response);
return Observable.just(new ServiceResponse<Page<ExperimentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentsListByWorkspaceOptions – Additional parameters for the operation
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<ExperimentInner> object if successful.
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentsListByWorkspaceOptions Additional parameters for the operation
* @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<ExperimentInner> object if successful.
*/
public PagedList<ExperimentInner> listByWorkspace(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions) {
ServiceResponse<Page<ExperimentInner>> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, experimentsListByWorkspaceOptions).toBlocking().single();
return new PagedList<ExperimentInner>(response.body()) {
@Override
public Page<ExperimentInner> nextPage(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentsListByWorkspaceOptions – Additional parameters for the operation
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentsListByWorkspaceOptions 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<ExperimentInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions, final ListOperationCallback<ExperimentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, experimentsListByWorkspaceOptions),
new Func1<String, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentsListByWorkspaceOptions – Additional parameters for the operation
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ExperimentInner> object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentsListByWorkspaceOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ExperimentInner> object
*/
public Observable<Page<ExperimentInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions) {
return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName, experimentsListByWorkspaceOptions)
.map(new Func1<ServiceResponse<Page<ExperimentInner>>, Page<ExperimentInner>>() {
@Override
public Page<ExperimentInner> call(ServiceResponse<Page<ExperimentInner>> response) {
return response.body();
}
});
}
Gets a list of Experiments within the specified Workspace.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentsListByWorkspaceOptions – Additional parameters for the operation
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ExperimentInner> object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentsListByWorkspaceOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ExperimentInner> object
*/
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions) {
return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, experimentsListByWorkspaceOptions)
.concatMap(new Func1<ServiceResponse<Page<ExperimentInner>>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(ServiceResponse<Page<ExperimentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets a list of Experiments within the specified Workspace.
ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs.
ServiceResponse> * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
ServiceResponse> * @param experimentsListByWorkspaceOptions Additional parameters for the operation
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<ExperimentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets a list of Experiments within the specified Workspace.
*
ServiceResponse<PageImpl<ExperimentInner>> * @param resourceGroupName Name of the resource group to which the resource belongs.
ServiceResponse<PageImpl<ExperimentInner>> * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
ServiceResponse<PageImpl<ExperimentInner>> * @param experimentsListByWorkspaceOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ExperimentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (workspaceName == null) {
throw new IllegalArgumentException("Parameter workspaceName 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.");
}
Validator.validate(experimentsListByWorkspaceOptions);
Integer maxResults = null;
if (experimentsListByWorkspaceOptions != null) {
maxResults = experimentsListByWorkspaceOptions.maxResults();
}
return service.listByWorkspace(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), maxResults, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ExperimentInner>> result = listByWorkspaceDelegate(response);
return Observable.just(new ServiceResponse<Page<ExperimentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<ExperimentInner>> listByWorkspaceDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<ExperimentInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<ExperimentInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Creates an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ExperimentInner object if successful.
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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 ExperimentInner object if successful.
*/
public ExperimentInner create(String resourceGroupName, String workspaceName, String experimentName) {
return createWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).toBlocking().last().body();
}
Creates an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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<ExperimentInner> createAsync(String resourceGroupName, String workspaceName, String experimentName, final ServiceCallback<ExperimentInner> serviceCallback) {
return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName), serviceCallback);
}
Creates an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ExperimentInner> createAsync(String resourceGroupName, String workspaceName, String experimentName) {
return createWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).map(new Func1<ServiceResponse<ExperimentInner>, ExperimentInner>() {
@Override
public ExperimentInner call(ServiceResponse<ExperimentInner> response) {
return response.body();
}
});
}
Creates an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<ExperimentInner>> createWithServiceResponseAsync(String resourceGroupName, String workspaceName, String experimentName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (workspaceName == null) {
throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null.");
}
if (experimentName == null) {
throw new IllegalArgumentException("Parameter experimentName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Observable<Response<ResponseBody>> observable = service.create(resourceGroupName, workspaceName, experimentName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<ExperimentInner>() { }.getType());
}
Creates an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ExperimentInner object if successful.
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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 ExperimentInner object if successful.
*/
public ExperimentInner beginCreate(String resourceGroupName, String workspaceName, String experimentName) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).toBlocking().single().body();
}
Creates an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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<ExperimentInner> beginCreateAsync(String resourceGroupName, String workspaceName, String experimentName, final ServiceCallback<ExperimentInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName), serviceCallback);
}
Creates an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ExperimentInner object
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExperimentInner object
*/
public Observable<ExperimentInner> beginCreateAsync(String resourceGroupName, String workspaceName, String experimentName) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).map(new Func1<ServiceResponse<ExperimentInner>, ExperimentInner>() {
@Override
public ExperimentInner call(ServiceResponse<ExperimentInner> response) {
return response.body();
}
});
}
Creates an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ExperimentInner object
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExperimentInner object
*/
public Observable<ServiceResponse<ExperimentInner>> beginCreateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String experimentName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (workspaceName == null) {
throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null.");
}
if (experimentName == null) {
throw new IllegalArgumentException("Parameter experimentName 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.beginCreate(resourceGroupName, workspaceName, experimentName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ExperimentInner>>>() {
@Override
public Observable<ServiceResponse<ExperimentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ExperimentInner> clientResponse = beginCreateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ExperimentInner> beginCreateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ExperimentInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ExperimentInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Deletes an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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
*/
public void delete(String resourceGroupName, String workspaceName, String experimentName) {
deleteWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).toBlocking().last().body();
}
Deletes an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<Void> deleteAsync(String resourceGroupName, String workspaceName, String experimentName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName), serviceCallback);
}
Deletes an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteAsync(String resourceGroupName, String workspaceName, String experimentName) {
return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String experimentName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (workspaceName == null) {
throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null.");
}
if (experimentName == null) {
throw new IllegalArgumentException("Parameter experimentName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, workspaceName, experimentName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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
*/
public void beginDelete(String resourceGroupName, String workspaceName, String experimentName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).toBlocking().single().body();
}
Deletes an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<Void> beginDeleteAsync(String resourceGroupName, String workspaceName, String experimentName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName), serviceCallback);
}
Deletes an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteAsync(String resourceGroupName, String workspaceName, String experimentName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String experimentName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (workspaceName == null) {
throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null.");
}
if (experimentName == null) {
throw new IllegalArgumentException("Parameter experimentName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.beginDelete(resourceGroupName, workspaceName, experimentName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = beginDeleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> beginDeleteDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets information about an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ExperimentInner object if successful.
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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 ExperimentInner object if successful.
*/
public ExperimentInner get(String resourceGroupName, String workspaceName, String experimentName) {
return getWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).toBlocking().single().body();
}
Gets information about an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @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<ExperimentInner> getAsync(String resourceGroupName, String workspaceName, String experimentName, final ServiceCallback<ExperimentInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName), serviceCallback);
}
Gets information about an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ExperimentInner object
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExperimentInner object
*/
public Observable<ExperimentInner> getAsync(String resourceGroupName, String workspaceName, String experimentName) {
return getWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).map(new Func1<ServiceResponse<ExperimentInner>, ExperimentInner>() {
@Override
public ExperimentInner call(ServiceResponse<ExperimentInner> response) {
return response.body();
}
});
}
Gets information about an Experiment.
Params: - resourceGroupName – Name of the resource group to which the resource belongs.
- workspaceName – The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- experimentName – The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ExperimentInner object
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExperimentInner object
*/
public Observable<ServiceResponse<ExperimentInner>> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String experimentName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (workspaceName == null) {
throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null.");
}
if (experimentName == null) {
throw new IllegalArgumentException("Parameter experimentName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.get(resourceGroupName, workspaceName, experimentName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ExperimentInner>>>() {
@Override
public Observable<ServiceResponse<ExperimentInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ExperimentInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ExperimentInner> getDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ExperimentInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ExperimentInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a list of Experiments within the specified Workspace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<ExperimentInner> object if successful.
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @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<ExperimentInner> object if successful.
*/
public PagedList<ExperimentInner> listByWorkspaceNext(final String nextPageLink) {
ServiceResponse<Page<ExperimentInner>> response = listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<ExperimentInner>(response.body()) {
@Override
public Page<ExperimentInner> nextPage(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets a list of Experiments within the specified Workspace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<ExperimentInner>> listByWorkspaceNextAsync(final String nextPageLink, final ServiceFuture<List<ExperimentInner>> serviceFuture, final ListOperationCallback<ExperimentInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByWorkspaceNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets a list of Experiments within the specified Workspace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ExperimentInner> object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @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<ExperimentInner> object
*/
public Observable<Page<ExperimentInner>> listByWorkspaceNextAsync(final String nextPageLink) {
return listByWorkspaceNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<ExperimentInner>>, Page<ExperimentInner>>() {
@Override
public Page<ExperimentInner> call(ServiceResponse<Page<ExperimentInner>> response) {
return response.body();
}
});
}
Gets a list of Experiments within the specified Workspace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<ExperimentInner> object
/**
* Gets a list of Experiments within the specified Workspace.
*
* @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<ExperimentInner> object
*/
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceNextWithServiceResponseAsync(final String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<ExperimentInner>>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(ServiceResponse<Page<ExperimentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets a list of Experiments within the specified Workspace.
ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<ExperimentInner> object wrapped in ServiceResponse
if successful.
/**
* Gets a list of Experiments within the specified Workspace.
*
ServiceResponse<PageImpl<ExperimentInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ExperimentInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceNextSinglePageAsync(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.listByWorkspaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ExperimentInner>> result = listByWorkspaceNextDelegate(response);
return Observable.just(new ServiceResponse<Page<ExperimentInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<ExperimentInner>> listByWorkspaceNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<ExperimentInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<ExperimentInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
}