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.FileServerCreateParameters;
import com.microsoft.azure.management.batchai.FileServersListByWorkspaceOptions;
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.Body;
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 FileServers.
/**
* An instance of this class provides access to all the operations defined
* in FileServers.
*/
public class FileServersInner {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private FileServersService service;
The service client containing this operation class. /** The service client containing this operation class. */
private BatchAIManagementClientImpl client;
Initializes an instance of FileServersInner.
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 FileServersInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public FileServersInner(Retrofit retrofit, BatchAIManagementClientImpl client) {
this.service = retrofit.create(FileServersService.class);
this.client = client;
}
The interface defining all the services for FileServers to be
used by Retrofit to perform actually REST calls.
/**
* The interface defining all the services for FileServers to be
* used by Retrofit to perform actually REST calls.
*/
interface FileServersService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batchai.FileServers create" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/fileServers/{fileServerName}")
Observable<Response<ResponseBody>> create(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("fileServerName") String fileServerName, @Path("subscriptionId") String subscriptionId, @Body FileServerCreateParameters parameters, @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.FileServers beginCreate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/fileServers/{fileServerName}")
Observable<Response<ResponseBody>> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("fileServerName") String fileServerName, @Path("subscriptionId") String subscriptionId, @Body FileServerCreateParameters parameters, @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.FileServers delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/fileServers/{fileServerName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("fileServerName") String fileServerName, @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.FileServers beginDelete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/fileServers/{fileServerName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("fileServerName") String fileServerName, @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.FileServers get" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/fileServers/{fileServerName}")
Observable<Response<ResponseBody>> get(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("fileServerName") String fileServerName, @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.FileServers listByWorkspace" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/fileServers")
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.FileServers listByWorkspaceNext" })
@GET
Observable<Response<ResponseBody>> listByWorkspaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Creates a File Server in the given 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.
- fileServerName – The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- parameters – The parameters to provide for File Server creation.
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 FileServerInner object if successful.
/**
* Creates a File Server in the given 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 fileServerName The name of the file server within the specified resource group. File server 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 parameters The parameters to provide for File Server creation.
* @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 FileServerInner object if successful.
*/
public FileServerInner create(String resourceGroupName, String workspaceName, String fileServerName, FileServerCreateParameters parameters) {
return createWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName, parameters).toBlocking().last().body();
}
Creates a File Server in the given 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.
- fileServerName – The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- parameters – The parameters to provide for File Server creation.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates a File Server in the given 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 fileServerName The name of the file server within the specified resource group. File server 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 parameters The parameters to provide for File Server creation.
* @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<FileServerInner> createAsync(String resourceGroupName, String workspaceName, String fileServerName, FileServerCreateParameters parameters, final ServiceCallback<FileServerInner> serviceCallback) {
return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName, parameters), serviceCallback);
}
Creates a File Server in the given 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.
- fileServerName – The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- parameters – The parameters to provide for File Server creation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Creates a File Server in the given 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 fileServerName The name of the file server within the specified resource group. File server 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 parameters The parameters to provide for File Server creation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<FileServerInner> createAsync(String resourceGroupName, String workspaceName, String fileServerName, FileServerCreateParameters parameters) {
return createWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName, parameters).map(new Func1<ServiceResponse<FileServerInner>, FileServerInner>() {
@Override
public FileServerInner call(ServiceResponse<FileServerInner> response) {
return response.body();
}
});
}
Creates a File Server in the given 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.
- fileServerName – The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- parameters – The parameters to provide for File Server creation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Creates a File Server in the given 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 fileServerName The name of the file server within the specified resource group. File server 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 parameters The parameters to provide for File Server creation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<FileServerInner>> createWithServiceResponseAsync(String resourceGroupName, String workspaceName, String fileServerName, FileServerCreateParameters parameters) {
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 (fileServerName == null) {
throw new IllegalArgumentException("Parameter fileServerName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(parameters);
Observable<Response<ResponseBody>> observable = service.create(resourceGroupName, workspaceName, fileServerName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<FileServerInner>() { }.getType());
}
Creates a File Server in the given 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.
- fileServerName – The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- parameters – The parameters to provide for File Server creation.
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 FileServerInner object if successful.
/**
* Creates a File Server in the given 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 fileServerName The name of the file server within the specified resource group. File server 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 parameters The parameters to provide for File Server creation.
* @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 FileServerInner object if successful.
*/
public FileServerInner beginCreate(String resourceGroupName, String workspaceName, String fileServerName, FileServerCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName, parameters).toBlocking().single().body();
}
Creates a File Server in the given 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.
- fileServerName – The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- parameters – The parameters to provide for File Server creation.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates a File Server in the given 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 fileServerName The name of the file server within the specified resource group. File server 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 parameters The parameters to provide for File Server creation.
* @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<FileServerInner> beginCreateAsync(String resourceGroupName, String workspaceName, String fileServerName, FileServerCreateParameters parameters, final ServiceCallback<FileServerInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName, parameters), serviceCallback);
}
Creates a File Server in the given 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.
- fileServerName – The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- parameters – The parameters to provide for File Server creation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the FileServerInner object
/**
* Creates a File Server in the given 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 fileServerName The name of the file server within the specified resource group. File server 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 parameters The parameters to provide for File Server creation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the FileServerInner object
*/
public Observable<FileServerInner> beginCreateAsync(String resourceGroupName, String workspaceName, String fileServerName, FileServerCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName, parameters).map(new Func1<ServiceResponse<FileServerInner>, FileServerInner>() {
@Override
public FileServerInner call(ServiceResponse<FileServerInner> response) {
return response.body();
}
});
}
Creates a File Server in the given 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.
- fileServerName – The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- parameters – The parameters to provide for File Server creation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the FileServerInner object
/**
* Creates a File Server in the given 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 fileServerName The name of the file server within the specified resource group. File server 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 parameters The parameters to provide for File Server creation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the FileServerInner object
*/
public Observable<ServiceResponse<FileServerInner>> beginCreateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String fileServerName, FileServerCreateParameters parameters) {
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 (fileServerName == null) {
throw new IllegalArgumentException("Parameter fileServerName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(parameters);
return service.beginCreate(resourceGroupName, workspaceName, fileServerName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FileServerInner>>>() {
@Override
public Observable<ServiceResponse<FileServerInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<FileServerInner> clientResponse = beginCreateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<FileServerInner> beginCreateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<FileServerInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<FileServerInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Deletes a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 fileServerName) {
deleteWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName).toBlocking().last().body();
}
Deletes a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 fileServerName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName), serviceCallback);
}
Deletes a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 fileServerName) {
return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 fileServerName) {
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 (fileServerName == null) {
throw new IllegalArgumentException("Parameter fileServerName 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, fileServerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 fileServerName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName).toBlocking().single().body();
}
Deletes a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 fileServerName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName), serviceCallback);
}
Deletes a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 fileServerName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 fileServerName) {
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 (fileServerName == null) {
throw new IllegalArgumentException("Parameter fileServerName 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, fileServerName, 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 a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 FileServerInner object if successful.
/**
* Gets information about a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 FileServerInner object if successful.
*/
public FileServerInner get(String resourceGroupName, String workspaceName, String fileServerName) {
return getWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName).toBlocking().single().body();
}
Gets information about a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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<FileServerInner> getAsync(String resourceGroupName, String workspaceName, String fileServerName, final ServiceCallback<FileServerInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName), serviceCallback);
}
Gets information about a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 FileServerInner object
/**
* Gets information about a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 FileServerInner object
*/
public Observable<FileServerInner> getAsync(String resourceGroupName, String workspaceName, String fileServerName) {
return getWithServiceResponseAsync(resourceGroupName, workspaceName, fileServerName).map(new Func1<ServiceResponse<FileServerInner>, FileServerInner>() {
@Override
public FileServerInner call(ServiceResponse<FileServerInner> response) {
return response.body();
}
});
}
Gets information about a File Server.
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.
- fileServerName – The name of the file server within the specified resource group. File server 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 FileServerInner object
/**
* Gets information about a File Server.
*
* @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 fileServerName The name of the file server within the specified resource group. File server 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 FileServerInner object
*/
public Observable<ServiceResponse<FileServerInner>> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String fileServerName) {
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 (fileServerName == null) {
throw new IllegalArgumentException("Parameter fileServerName 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, fileServerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FileServerInner>>>() {
@Override
public Observable<ServiceResponse<FileServerInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<FileServerInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<FileServerInner> getDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<FileServerInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<FileServerInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a list of File Servers associated with 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<FileServerInner> object if successful.
/**
* Gets a list of File Servers associated with 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<FileServerInner> object if successful.
*/
public PagedList<FileServerInner> listByWorkspace(final String resourceGroupName, final String workspaceName) {
ServiceResponse<Page<FileServerInner>> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName).toBlocking().single();
return new PagedList<FileServerInner>(response.body()) {
@Override
public Page<FileServerInner> nextPage(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets a list of File Servers associated with 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 File Servers associated with 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<FileServerInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ListOperationCallback<FileServerInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName),
new Func1<String, Observable<ServiceResponse<Page<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets a list of File Servers associated with 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<FileServerInner> object
/**
* Gets a list of File Servers associated with 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<FileServerInner> object
*/
public Observable<Page<FileServerInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) {
return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName)
.map(new Func1<ServiceResponse<Page<FileServerInner>>, Page<FileServerInner>>() {
@Override
public Page<FileServerInner> call(ServiceResponse<Page<FileServerInner>> response) {
return response.body();
}
});
}
Gets a list of File Servers associated with 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<FileServerInner> object
/**
* Gets a list of File Servers associated with 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<FileServerInner> object
*/
public Observable<ServiceResponse<Page<FileServerInner>>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName) {
return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)
.concatMap(new Func1<ServiceResponse<Page<FileServerInner>>, Observable<ServiceResponse<Page<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(ServiceResponse<Page<FileServerInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets a list of File Servers associated with 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<FileServerInner> object wrapped in ServiceResponse
if successful.
/**
* Gets a list of File Servers associated with 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<FileServerInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<FileServerInner>>> 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 FileServersListByWorkspaceOptions fileServersListByWorkspaceOptions = 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<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<FileServerInner>> result = listByWorkspaceDelegate(response);
return Observable.just(new ServiceResponse<Page<FileServerInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Gets a list of File Servers associated with 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.
- fileServersListByWorkspaceOptions – 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<FileServerInner> object if successful.
/**
* Gets a list of File Servers associated with 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 fileServersListByWorkspaceOptions 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<FileServerInner> object if successful.
*/
public PagedList<FileServerInner> listByWorkspace(final String resourceGroupName, final String workspaceName, final FileServersListByWorkspaceOptions fileServersListByWorkspaceOptions) {
ServiceResponse<Page<FileServerInner>> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, fileServersListByWorkspaceOptions).toBlocking().single();
return new PagedList<FileServerInner>(response.body()) {
@Override
public Page<FileServerInner> nextPage(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets a list of File Servers associated with 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.
- fileServersListByWorkspaceOptions – 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 File Servers associated with 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 fileServersListByWorkspaceOptions 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<FileServerInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final FileServersListByWorkspaceOptions fileServersListByWorkspaceOptions, final ListOperationCallback<FileServerInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, fileServersListByWorkspaceOptions),
new Func1<String, Observable<ServiceResponse<Page<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets a list of File Servers associated with 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.
- fileServersListByWorkspaceOptions – Additional parameters for the operation
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<FileServerInner> object
/**
* Gets a list of File Servers associated with 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 fileServersListByWorkspaceOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<FileServerInner> object
*/
public Observable<Page<FileServerInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final FileServersListByWorkspaceOptions fileServersListByWorkspaceOptions) {
return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName, fileServersListByWorkspaceOptions)
.map(new Func1<ServiceResponse<Page<FileServerInner>>, Page<FileServerInner>>() {
@Override
public Page<FileServerInner> call(ServiceResponse<Page<FileServerInner>> response) {
return response.body();
}
});
}
Gets a list of File Servers associated with 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.
- fileServersListByWorkspaceOptions – Additional parameters for the operation
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<FileServerInner> object
/**
* Gets a list of File Servers associated with 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 fileServersListByWorkspaceOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<FileServerInner> object
*/
public Observable<ServiceResponse<Page<FileServerInner>>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final FileServersListByWorkspaceOptions fileServersListByWorkspaceOptions) {
return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, fileServersListByWorkspaceOptions)
.concatMap(new Func1<ServiceResponse<Page<FileServerInner>>, Observable<ServiceResponse<Page<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(ServiceResponse<Page<FileServerInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets a list of File Servers associated with 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 fileServersListByWorkspaceOptions Additional parameters for the operation
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<FileServerInner> object wrapped in ServiceResponse
if successful.
/**
* Gets a list of File Servers associated with the specified workspace.
*
ServiceResponse<PageImpl<FileServerInner>> * @param resourceGroupName Name of the resource group to which the resource belongs.
ServiceResponse<PageImpl<FileServerInner>> * @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<FileServerInner>> * @param fileServersListByWorkspaceOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<FileServerInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<FileServerInner>>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName, final FileServersListByWorkspaceOptions fileServersListByWorkspaceOptions) {
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(fileServersListByWorkspaceOptions);
Integer maxResults = null;
if (fileServersListByWorkspaceOptions != null) {
maxResults = fileServersListByWorkspaceOptions.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<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<FileServerInner>> result = listByWorkspaceDelegate(response);
return Observable.just(new ServiceResponse<Page<FileServerInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<FileServerInner>> listByWorkspaceDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<FileServerInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<FileServerInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a list of File Servers associated with 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<FileServerInner> object if successful.
/**
* Gets a list of File Servers associated with 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<FileServerInner> object if successful.
*/
public PagedList<FileServerInner> listByWorkspaceNext(final String nextPageLink) {
ServiceResponse<Page<FileServerInner>> response = listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<FileServerInner>(response.body()) {
@Override
public Page<FileServerInner> nextPage(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets a list of File Servers associated with 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 File Servers associated with 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<FileServerInner>> listByWorkspaceNextAsync(final String nextPageLink, final ServiceFuture<List<FileServerInner>> serviceFuture, final ListOperationCallback<FileServerInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByWorkspaceNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets a list of File Servers associated with 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<FileServerInner> object
/**
* Gets a list of File Servers associated with 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<FileServerInner> object
*/
public Observable<Page<FileServerInner>> listByWorkspaceNextAsync(final String nextPageLink) {
return listByWorkspaceNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<FileServerInner>>, Page<FileServerInner>>() {
@Override
public Page<FileServerInner> call(ServiceResponse<Page<FileServerInner>> response) {
return response.body();
}
});
}
Gets a list of File Servers associated with 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<FileServerInner> object
/**
* Gets a list of File Servers associated with 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<FileServerInner> object
*/
public Observable<ServiceResponse<Page<FileServerInner>>> listByWorkspaceNextWithServiceResponseAsync(final String nextPageLink) {
return listByWorkspaceNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<FileServerInner>>, Observable<ServiceResponse<Page<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(ServiceResponse<Page<FileServerInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink));
}
});
}
Gets a list of File Servers associated with 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<FileServerInner> object wrapped in ServiceResponse
if successful.
/**
* Gets a list of File Servers associated with the specified workspace.
*
ServiceResponse<PageImpl<FileServerInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<FileServerInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<FileServerInner>>> 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<FileServerInner>>>>() {
@Override
public Observable<ServiceResponse<Page<FileServerInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<FileServerInner>> result = listByWorkspaceNextDelegate(response);
return Observable.just(new ServiceResponse<Page<FileServerInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<FileServerInner>> listByWorkspaceNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<FileServerInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<FileServerInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
}