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.cosmosdb.implementation;
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.management.cosmosdb.MongoDBCollectionCreateUpdateParameters;
import com.microsoft.azure.management.cosmosdb.MongoDBDatabaseCreateUpdateParameters;
import com.microsoft.azure.management.cosmosdb.ThroughputSettingsUpdateParameters;
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.Response;
import rx.functions.Func1;
import rx.Observable;
An instance of this class provides access to all the operations defined
in MongoDBResources.
/**
* An instance of this class provides access to all the operations defined
* in MongoDBResources.
*/
public class MongoDBResourcesInner {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private MongoDBResourcesService service;
The service client containing this operation class. /** The service client containing this operation class. */
private CosmosDBImpl client;
Initializes an instance of MongoDBResourcesInner.
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 MongoDBResourcesInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public MongoDBResourcesInner(Retrofit retrofit, CosmosDBImpl client) {
this.service = retrofit.create(MongoDBResourcesService.class);
this.client = client;
}
The interface defining all the services for MongoDBResources to be
used by Retrofit to perform actually REST calls.
/**
* The interface defining all the services for MongoDBResources to be
* used by Retrofit to perform actually REST calls.
*/
interface MongoDBResourcesService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.MongoDBResources listMongoDBDatabases" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases")
Observable<Response<ResponseBody>> listMongoDBDatabases(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.MongoDBResources getMongoDBDatabase" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}")
Observable<Response<ResponseBody>> getMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.MongoDBResources createUpdateMongoDBDatabase" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}")
Observable<Response<ResponseBody>> createUpdateMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, @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.cosmosdb.MongoDBResources beginCreateUpdateMongoDBDatabase" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}")
Observable<Response<ResponseBody>> beginCreateUpdateMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, @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.cosmosdb.MongoDBResources deleteMongoDBDatabase" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> deleteMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.MongoDBResources beginDeleteMongoDBDatabase" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> beginDeleteMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.MongoDBResources getMongoDBDatabaseThroughput" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default")
Observable<Response<ResponseBody>> getMongoDBDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.MongoDBResources updateMongoDBDatabaseThroughput" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default")
Observable<Response<ResponseBody>> updateMongoDBDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body ThroughputSettingsUpdateParameters updateThroughputParameters, @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.cosmosdb.MongoDBResources beginUpdateMongoDBDatabaseThroughput" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default")
Observable<Response<ResponseBody>> beginUpdateMongoDBDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body ThroughputSettingsUpdateParameters updateThroughputParameters, @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.cosmosdb.MongoDBResources listMongoDBCollections" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections")
Observable<Response<ResponseBody>> listMongoDBCollections(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.MongoDBResources getMongoDBCollection" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}")
Observable<Response<ResponseBody>> getMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @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.cosmosdb.MongoDBResources createUpdateMongoDBCollection" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}")
Observable<Response<ResponseBody>> createUpdateMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Body MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, @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.cosmosdb.MongoDBResources beginCreateUpdateMongoDBCollection" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}")
Observable<Response<ResponseBody>> beginCreateUpdateMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Body MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, @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.cosmosdb.MongoDBResources deleteMongoDBCollection" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> deleteMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @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.cosmosdb.MongoDBResources beginDeleteMongoDBCollection" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> beginDeleteMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @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.cosmosdb.MongoDBResources getMongoDBCollectionThroughput" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default")
Observable<Response<ResponseBody>> getMongoDBCollectionThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @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.cosmosdb.MongoDBResources updateMongoDBCollectionThroughput" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default")
Observable<Response<ResponseBody>> updateMongoDBCollectionThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Body ThroughputSettingsUpdateParameters updateThroughputParameters, @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.cosmosdb.MongoDBResources beginUpdateMongoDBCollectionThroughput" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default")
Observable<Response<ResponseBody>> beginUpdateMongoDBCollectionThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Body ThroughputSettingsUpdateParameters updateThroughputParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Lists the MongoDB databases under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
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 List<MongoDBDatabaseGetResultsInner> object if successful.
/**
* Lists the MongoDB databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @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 List<MongoDBDatabaseGetResultsInner> object if successful.
*/
public List<MongoDBDatabaseGetResultsInner> listMongoDBDatabases(String resourceGroupName, String accountName) {
return listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body();
}
Lists the MongoDB databases under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Lists the MongoDB databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @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<MongoDBDatabaseGetResultsInner>> listMongoDBDatabasesAsync(String resourceGroupName, String accountName, final ServiceCallback<List<MongoDBDatabaseGetResultsInner>> serviceCallback) {
return ServiceFuture.fromResponse(listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback);
}
Lists the MongoDB databases under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<MongoDBDatabaseGetResultsInner> object
/**
* Lists the MongoDB databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<MongoDBDatabaseGetResultsInner> object
*/
public Observable<List<MongoDBDatabaseGetResultsInner>> listMongoDBDatabasesAsync(String resourceGroupName, String accountName) {
return listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<List<MongoDBDatabaseGetResultsInner>>, List<MongoDBDatabaseGetResultsInner>>() {
@Override
public List<MongoDBDatabaseGetResultsInner> call(ServiceResponse<List<MongoDBDatabaseGetResultsInner>> response) {
return response.body();
}
});
}
Lists the MongoDB databases under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<MongoDBDatabaseGetResultsInner> object
/**
* Lists the MongoDB databases under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<MongoDBDatabaseGetResultsInner> object
*/
public Observable<ServiceResponse<List<MongoDBDatabaseGetResultsInner>>> listMongoDBDatabasesWithServiceResponseAsync(String resourceGroupName, String accountName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
return service.listMongoDBDatabases(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<MongoDBDatabaseGetResultsInner>>>>() {
@Override
public Observable<ServiceResponse<List<MongoDBDatabaseGetResultsInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<MongoDBDatabaseGetResultsInner>> result = listMongoDBDatabasesDelegate(response);
List<MongoDBDatabaseGetResultsInner> items = null;
if (result.body() != null) {
items = result.body().items();
}
ServiceResponse<List<MongoDBDatabaseGetResultsInner>> clientResponse = new ServiceResponse<List<MongoDBDatabaseGetResultsInner>>(items, result.response());
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<MongoDBDatabaseGetResultsInner>> listMongoDBDatabasesDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<MongoDBDatabaseGetResultsInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<MongoDBDatabaseGetResultsInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
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 MongoDBDatabaseGetResultsInner object if successful.
/**
* Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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 MongoDBDatabaseGetResultsInner object if successful.
*/
public MongoDBDatabaseGetResultsInner getMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) {
return getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body();
}
Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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<MongoDBDatabaseGetResultsInner> getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback<MongoDBDatabaseGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback);
}
Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the MongoDBDatabaseGetResultsInner object
/**
* Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the MongoDBDatabaseGetResultsInner object
*/
public Observable<MongoDBDatabaseGetResultsInner> getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) {
return getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1<ServiceResponse<MongoDBDatabaseGetResultsInner>, MongoDBDatabaseGetResultsInner>() {
@Override
public MongoDBDatabaseGetResultsInner call(ServiceResponse<MongoDBDatabaseGetResultsInner> response) {
return response.body();
}
});
}
Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the MongoDBDatabaseGetResultsInner object
/**
* Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the MongoDBDatabaseGetResultsInner object
*/
public Observable<ServiceResponse<MongoDBDatabaseGetResultsInner>> getMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
return service.getMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<MongoDBDatabaseGetResultsInner>>>() {
@Override
public Observable<ServiceResponse<MongoDBDatabaseGetResultsInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<MongoDBDatabaseGetResultsInner> clientResponse = getMongoDBDatabaseDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<MongoDBDatabaseGetResultsInner> getMongoDBDatabaseDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<MongoDBDatabaseGetResultsInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<MongoDBDatabaseGetResultsInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Create or updates Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- createUpdateMongoDBDatabaseParameters – The parameters to provide for the current MongoDB database.
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 MongoDBDatabaseGetResultsInner object if successful.
/**
* Create or updates Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database.
* @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 MongoDBDatabaseGetResultsInner object if successful.
*/
public MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) {
return createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).toBlocking().last().body();
}
Create or updates Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- createUpdateMongoDBDatabaseParameters – The parameters to provide for the current MongoDB database.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Create or updates Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database.
* @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<MongoDBDatabaseGetResultsInner> createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, final ServiceCallback<MongoDBDatabaseGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters), serviceCallback);
}
Create or updates Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- createUpdateMongoDBDatabaseParameters – The parameters to provide for the current MongoDB database.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Create or updates Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<MongoDBDatabaseGetResultsInner> createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) {
return createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).map(new Func1<ServiceResponse<MongoDBDatabaseGetResultsInner>, MongoDBDatabaseGetResultsInner>() {
@Override
public MongoDBDatabaseGetResultsInner call(ServiceResponse<MongoDBDatabaseGetResultsInner> response) {
return response.body();
}
});
}
Create or updates Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- createUpdateMongoDBDatabaseParameters – The parameters to provide for the current MongoDB database.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Create or updates Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<MongoDBDatabaseGetResultsInner>> createUpdateMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (createUpdateMongoDBDatabaseParameters == null) {
throw new IllegalArgumentException("Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null.");
}
Validator.validate(createUpdateMongoDBDatabaseParameters);
final String apiVersion = "2019-08-01";
Observable<Response<ResponseBody>> observable = service.createUpdateMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, createUpdateMongoDBDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<MongoDBDatabaseGetResultsInner>() { }.getType());
}
Create or updates Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- createUpdateMongoDBDatabaseParameters – The parameters to provide for the current MongoDB database.
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 MongoDBDatabaseGetResultsInner object if successful.
/**
* Create or updates Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database.
* @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 MongoDBDatabaseGetResultsInner object if successful.
*/
public MongoDBDatabaseGetResultsInner beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) {
return beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).toBlocking().single().body();
}
Create or updates Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- createUpdateMongoDBDatabaseParameters – The parameters to provide for the current MongoDB database.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Create or updates Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database.
* @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<MongoDBDatabaseGetResultsInner> beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, final ServiceCallback<MongoDBDatabaseGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters), serviceCallback);
}
Create or updates Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- createUpdateMongoDBDatabaseParameters – The parameters to provide for the current MongoDB database.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the MongoDBDatabaseGetResultsInner object
/**
* Create or updates Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the MongoDBDatabaseGetResultsInner object
*/
public Observable<MongoDBDatabaseGetResultsInner> beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) {
return beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).map(new Func1<ServiceResponse<MongoDBDatabaseGetResultsInner>, MongoDBDatabaseGetResultsInner>() {
@Override
public MongoDBDatabaseGetResultsInner call(ServiceResponse<MongoDBDatabaseGetResultsInner> response) {
return response.body();
}
});
}
Create or updates Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- createUpdateMongoDBDatabaseParameters – The parameters to provide for the current MongoDB database.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the MongoDBDatabaseGetResultsInner object
/**
* Create or updates Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the MongoDBDatabaseGetResultsInner object
*/
public Observable<ServiceResponse<MongoDBDatabaseGetResultsInner>> beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (createUpdateMongoDBDatabaseParameters == null) {
throw new IllegalArgumentException("Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null.");
}
Validator.validate(createUpdateMongoDBDatabaseParameters);
final String apiVersion = "2019-08-01";
return service.beginCreateUpdateMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, createUpdateMongoDBDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<MongoDBDatabaseGetResultsInner>>>() {
@Override
public Observable<ServiceResponse<MongoDBDatabaseGetResultsInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<MongoDBDatabaseGetResultsInner> clientResponse = beginCreateUpdateMongoDBDatabaseDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<MongoDBDatabaseGetResultsInner> beginCreateUpdateMongoDBDatabaseDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<MongoDBDatabaseGetResultsInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<MongoDBDatabaseGetResultsInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Deletes an existing Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
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 existing Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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 deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) {
deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body();
}
Deletes an existing Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes an existing Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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> deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback);
}
Deletes an existing Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes an existing Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) {
return deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes an existing Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes an existing Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
Observable<Response<ResponseBody>> observable = service.deleteMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes an existing Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
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 existing Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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 beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) {
beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body();
}
Deletes an existing Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes an existing Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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> beginDeleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback);
}
Deletes an existing Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes an existing Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) {
return beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes an existing Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes an existing Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
return service.beginDeleteMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, 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 = beginDeleteMongoDBDatabaseDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> beginDeleteMongoDBDatabaseDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(202, new TypeToken<Void>() { }.getType())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
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 ThroughputSettingsGetResultsInner object if successful.
/**
* Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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 ThroughputSettingsGetResultsInner object if successful.
*/
public ThroughputSettingsGetResultsInner getMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName) {
return getMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body();
}
Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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<ThroughputSettingsGetResultsInner> getMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback<ThroughputSettingsGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(getMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback);
}
Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ThroughputSettingsGetResultsInner object
/**
* Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ThroughputSettingsGetResultsInner object
*/
public Observable<ThroughputSettingsGetResultsInner> getMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName) {
return getMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1<ServiceResponse<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>() {
@Override
public ThroughputSettingsGetResultsInner call(ServiceResponse<ThroughputSettingsGetResultsInner> response) {
return response.body();
}
});
}
Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ThroughputSettingsGetResultsInner object
/**
* Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ThroughputSettingsGetResultsInner object
*/
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> getMongoDBDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
return service.getMongoDBDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ThroughputSettingsGetResultsInner>>>() {
@Override
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ThroughputSettingsGetResultsInner> clientResponse = getMongoDBDatabaseThroughputDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ThroughputSettingsGetResultsInner> getMongoDBDatabaseThroughputDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ThroughputSettingsGetResultsInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ThroughputSettingsGetResultsInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Update RUs per second of the an Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB database.
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 ThroughputSettingsGetResultsInner object if successful.
/**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB database.
* @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 ThroughputSettingsGetResultsInner object if successful.
*/
public ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return updateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).toBlocking().last().body();
}
Update RUs per second of the an Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB database.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB database.
* @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<ThroughputSettingsGetResultsInner> updateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback<ThroughputSettingsGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(updateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters), serviceCallback);
}
Update RUs per second of the an Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB database.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ThroughputSettingsGetResultsInner> updateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return updateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).map(new Func1<ServiceResponse<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>() {
@Override
public ThroughputSettingsGetResultsInner call(ServiceResponse<ThroughputSettingsGetResultsInner> response) {
return response.body();
}
});
}
Update RUs per second of the an Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB database.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> updateMongoDBDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (updateThroughputParameters == null) {
throw new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.");
}
Validator.validate(updateThroughputParameters);
final String apiVersion = "2019-08-01";
Observable<Response<ResponseBody>> observable = service.updateMongoDBDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<ThroughputSettingsGetResultsInner>() { }.getType());
}
Update RUs per second of the an Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB database.
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 ThroughputSettingsGetResultsInner object if successful.
/**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB database.
* @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 ThroughputSettingsGetResultsInner object if successful.
*/
public ThroughputSettingsGetResultsInner beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).toBlocking().single().body();
}
Update RUs per second of the an Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB database.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB database.
* @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<ThroughputSettingsGetResultsInner> beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback<ThroughputSettingsGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters), serviceCallback);
}
Update RUs per second of the an Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB database.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ThroughputSettingsGetResultsInner object
/**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ThroughputSettingsGetResultsInner object
*/
public Observable<ThroughputSettingsGetResultsInner> beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).map(new Func1<ServiceResponse<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>() {
@Override
public ThroughputSettingsGetResultsInner call(ServiceResponse<ThroughputSettingsGetResultsInner> response) {
return response.body();
}
});
}
Update RUs per second of the an Azure Cosmos DB MongoDB database.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB database.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ThroughputSettingsGetResultsInner object
/**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB database.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ThroughputSettingsGetResultsInner object
*/
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (updateThroughputParameters == null) {
throw new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.");
}
Validator.validate(updateThroughputParameters);
final String apiVersion = "2019-08-01";
return service.beginUpdateMongoDBDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ThroughputSettingsGetResultsInner>>>() {
@Override
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ThroughputSettingsGetResultsInner> clientResponse = beginUpdateMongoDBDatabaseThroughputDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ThroughputSettingsGetResultsInner> beginUpdateMongoDBDatabaseThroughputDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ThroughputSettingsGetResultsInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ThroughputSettingsGetResultsInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Lists the MongoDB collection under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
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 List<MongoDBCollectionGetResultsInner> object if successful.
/**
* Lists the MongoDB collection under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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 List<MongoDBCollectionGetResultsInner> object if successful.
*/
public List<MongoDBCollectionGetResultsInner> listMongoDBCollections(String resourceGroupName, String accountName, String databaseName) {
return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body();
}
Lists the MongoDB collection under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Lists the MongoDB collection under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @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<MongoDBCollectionGetResultsInner>> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback<List<MongoDBCollectionGetResultsInner>> serviceCallback) {
return ServiceFuture.fromResponse(listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback);
}
Lists the MongoDB collection under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<MongoDBCollectionGetResultsInner> object
/**
* Lists the MongoDB collection under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<MongoDBCollectionGetResultsInner> object
*/
public Observable<List<MongoDBCollectionGetResultsInner>> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName) {
return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1<ServiceResponse<List<MongoDBCollectionGetResultsInner>>, List<MongoDBCollectionGetResultsInner>>() {
@Override
public List<MongoDBCollectionGetResultsInner> call(ServiceResponse<List<MongoDBCollectionGetResultsInner>> response) {
return response.body();
}
});
}
Lists the MongoDB collection under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<MongoDBCollectionGetResultsInner> object
/**
* Lists the MongoDB collection under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<MongoDBCollectionGetResultsInner> object
*/
public Observable<ServiceResponse<List<MongoDBCollectionGetResultsInner>>> listMongoDBCollectionsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
return service.listMongoDBCollections(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<MongoDBCollectionGetResultsInner>>>>() {
@Override
public Observable<ServiceResponse<List<MongoDBCollectionGetResultsInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<MongoDBCollectionGetResultsInner>> result = listMongoDBCollectionsDelegate(response);
List<MongoDBCollectionGetResultsInner> items = null;
if (result.body() != null) {
items = result.body().items();
}
ServiceResponse<List<MongoDBCollectionGetResultsInner>> clientResponse = new ServiceResponse<List<MongoDBCollectionGetResultsInner>>(items, result.response());
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<MongoDBCollectionGetResultsInner>> listMongoDBCollectionsDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<MongoDBCollectionGetResultsInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<MongoDBCollectionGetResultsInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets the MongoDB collection under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
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 MongoDBCollectionGetResultsInner object if successful.
/**
* Gets the MongoDB collection under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @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 MongoDBCollectionGetResultsInner object if successful.
*/
public MongoDBCollectionGetResultsInner getMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) {
return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body();
}
Gets the MongoDB collection under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets the MongoDB collection under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @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<MongoDBCollectionGetResultsInner> getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback<MongoDBCollectionGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback);
}
Gets the MongoDB collection under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the MongoDBCollectionGetResultsInner object
/**
* Gets the MongoDB collection under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the MongoDBCollectionGetResultsInner object
*/
public Observable<MongoDBCollectionGetResultsInner> getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) {
return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1<ServiceResponse<MongoDBCollectionGetResultsInner>, MongoDBCollectionGetResultsInner>() {
@Override
public MongoDBCollectionGetResultsInner call(ServiceResponse<MongoDBCollectionGetResultsInner> response) {
return response.body();
}
});
}
Gets the MongoDB collection under an existing Azure Cosmos DB database account.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the MongoDBCollectionGetResultsInner object
/**
* Gets the MongoDB collection under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the MongoDBCollectionGetResultsInner object
*/
public Observable<ServiceResponse<MongoDBCollectionGetResultsInner>> getMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("Parameter collectionName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
return service.getMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<MongoDBCollectionGetResultsInner>>>() {
@Override
public Observable<ServiceResponse<MongoDBCollectionGetResultsInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<MongoDBCollectionGetResultsInner> clientResponse = getMongoDBCollectionDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<MongoDBCollectionGetResultsInner> getMongoDBCollectionDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<MongoDBCollectionGetResultsInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<MongoDBCollectionGetResultsInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Create or update an Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- createUpdateMongoDBCollectionParameters – The parameters to provide for the current MongoDB Collection.
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 MongoDBCollectionGetResultsInner object if successful.
/**
* Create or update an Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection.
* @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 MongoDBCollectionGetResultsInner object if successful.
*/
public MongoDBCollectionGetResultsInner createUpdateMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) {
return createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).toBlocking().last().body();
}
Create or update an Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- createUpdateMongoDBCollectionParameters – The parameters to provide for the current MongoDB Collection.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Create or update an Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection.
* @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<MongoDBCollectionGetResultsInner> createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, final ServiceCallback<MongoDBCollectionGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters), serviceCallback);
}
Create or update an Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- createUpdateMongoDBCollectionParameters – The parameters to provide for the current MongoDB Collection.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Create or update an Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<MongoDBCollectionGetResultsInner> createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) {
return createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1<ServiceResponse<MongoDBCollectionGetResultsInner>, MongoDBCollectionGetResultsInner>() {
@Override
public MongoDBCollectionGetResultsInner call(ServiceResponse<MongoDBCollectionGetResultsInner> response) {
return response.body();
}
});
}
Create or update an Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- createUpdateMongoDBCollectionParameters – The parameters to provide for the current MongoDB Collection.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Create or update an Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<MongoDBCollectionGetResultsInner>> createUpdateMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("Parameter collectionName is required and cannot be null.");
}
if (createUpdateMongoDBCollectionParameters == null) {
throw new IllegalArgumentException("Parameter createUpdateMongoDBCollectionParameters is required and cannot be null.");
}
Validator.validate(createUpdateMongoDBCollectionParameters);
final String apiVersion = "2019-08-01";
Observable<Response<ResponseBody>> observable = service.createUpdateMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, createUpdateMongoDBCollectionParameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<MongoDBCollectionGetResultsInner>() { }.getType());
}
Create or update an Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- createUpdateMongoDBCollectionParameters – The parameters to provide for the current MongoDB Collection.
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 MongoDBCollectionGetResultsInner object if successful.
/**
* Create or update an Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection.
* @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 MongoDBCollectionGetResultsInner object if successful.
*/
public MongoDBCollectionGetResultsInner beginCreateUpdateMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) {
return beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).toBlocking().single().body();
}
Create or update an Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- createUpdateMongoDBCollectionParameters – The parameters to provide for the current MongoDB Collection.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Create or update an Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection.
* @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<MongoDBCollectionGetResultsInner> beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, final ServiceCallback<MongoDBCollectionGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters), serviceCallback);
}
Create or update an Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- createUpdateMongoDBCollectionParameters – The parameters to provide for the current MongoDB Collection.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the MongoDBCollectionGetResultsInner object
/**
* Create or update an Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the MongoDBCollectionGetResultsInner object
*/
public Observable<MongoDBCollectionGetResultsInner> beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) {
return beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1<ServiceResponse<MongoDBCollectionGetResultsInner>, MongoDBCollectionGetResultsInner>() {
@Override
public MongoDBCollectionGetResultsInner call(ServiceResponse<MongoDBCollectionGetResultsInner> response) {
return response.body();
}
});
}
Create or update an Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- createUpdateMongoDBCollectionParameters – The parameters to provide for the current MongoDB Collection.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the MongoDBCollectionGetResultsInner object
/**
* Create or update an Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the MongoDBCollectionGetResultsInner object
*/
public Observable<ServiceResponse<MongoDBCollectionGetResultsInner>> beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("Parameter collectionName is required and cannot be null.");
}
if (createUpdateMongoDBCollectionParameters == null) {
throw new IllegalArgumentException("Parameter createUpdateMongoDBCollectionParameters is required and cannot be null.");
}
Validator.validate(createUpdateMongoDBCollectionParameters);
final String apiVersion = "2019-08-01";
return service.beginCreateUpdateMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, createUpdateMongoDBCollectionParameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<MongoDBCollectionGetResultsInner>>>() {
@Override
public Observable<ServiceResponse<MongoDBCollectionGetResultsInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<MongoDBCollectionGetResultsInner> clientResponse = beginCreateUpdateMongoDBCollectionDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<MongoDBCollectionGetResultsInner> beginCreateUpdateMongoDBCollectionDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<MongoDBCollectionGetResultsInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<MongoDBCollectionGetResultsInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Deletes an existing Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
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 existing Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @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 deleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) {
deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().last().body();
}
Deletes an existing Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes an existing Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @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> deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback);
}
Deletes an existing Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes an existing Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<Void> deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) {
return deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes an existing Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Deletes an existing Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<Void>> deleteMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("Parameter collectionName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
Observable<Response<ResponseBody>> observable = service.deleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
}
Deletes an existing Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
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 existing Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @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 beginDeleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) {
beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body();
}
Deletes an existing Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Deletes an existing Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @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> beginDeleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback);
}
Deletes an existing Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes an existing Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> beginDeleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) {
return beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes an existing Azure Cosmos DB MongoDB Collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* Deletes an existing Azure Cosmos DB MongoDB Collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> beginDeleteMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("Parameter collectionName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
return service.beginDeleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, 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 = beginDeleteMongoDBCollectionDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> beginDeleteMongoDBCollectionDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(202, new TypeToken<Void>() { }.getType())
.register(204, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
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 ThroughputSettingsGetResultsInner object if successful.
/**
* Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @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 ThroughputSettingsGetResultsInner object if successful.
*/
public ThroughputSettingsGetResultsInner getMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName) {
return getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body();
}
Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @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<ThroughputSettingsGetResultsInner> getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback<ThroughputSettingsGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback);
}
Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ThroughputSettingsGetResultsInner object
/**
* Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ThroughputSettingsGetResultsInner object
*/
public Observable<ThroughputSettingsGetResultsInner> getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) {
return getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1<ServiceResponse<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>() {
@Override
public ThroughputSettingsGetResultsInner call(ServiceResponse<ThroughputSettingsGetResultsInner> response) {
return response.body();
}
});
}
Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ThroughputSettingsGetResultsInner object
/**
* Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ThroughputSettingsGetResultsInner object
*/
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> getMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("Parameter collectionName is required and cannot be null.");
}
final String apiVersion = "2019-08-01";
return service.getMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ThroughputSettingsGetResultsInner>>>() {
@Override
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ThroughputSettingsGetResultsInner> clientResponse = getMongoDBCollectionThroughputDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ThroughputSettingsGetResultsInner> getMongoDBCollectionThroughputDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ThroughputSettingsGetResultsInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ThroughputSettingsGetResultsInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB collection.
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 ThroughputSettingsGetResultsInner object if successful.
/**
* Update the RUs per second of an Azure Cosmos DB MongoDB collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB collection.
* @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 ThroughputSettingsGetResultsInner object if successful.
*/
public ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).toBlocking().last().body();
}
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB collection.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Update the RUs per second of an Azure Cosmos DB MongoDB collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB collection.
* @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<ThroughputSettingsGetResultsInner> updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback<ThroughputSettingsGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters), serviceCallback);
}
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB collection.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Update the RUs per second of an Azure Cosmos DB MongoDB collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB collection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ThroughputSettingsGetResultsInner> updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).map(new Func1<ServiceResponse<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>() {
@Override
public ThroughputSettingsGetResultsInner call(ServiceResponse<ThroughputSettingsGetResultsInner> response) {
return response.body();
}
});
}
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB collection.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable for the request
/**
* Update the RUs per second of an Azure Cosmos DB MongoDB collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB collection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> updateMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("Parameter collectionName is required and cannot be null.");
}
if (updateThroughputParameters == null) {
throw new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.");
}
Validator.validate(updateThroughputParameters);
final String apiVersion = "2019-08-01";
Observable<Response<ResponseBody>> observable = service.updateMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<ThroughputSettingsGetResultsInner>() { }.getType());
}
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB collection.
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 ThroughputSettingsGetResultsInner object if successful.
/**
* Update the RUs per second of an Azure Cosmos DB MongoDB collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB collection.
* @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 ThroughputSettingsGetResultsInner object if successful.
*/
public ThroughputSettingsGetResultsInner beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).toBlocking().single().body();
}
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB collection.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Update the RUs per second of an Azure Cosmos DB MongoDB collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB collection.
* @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<ThroughputSettingsGetResultsInner> beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback<ThroughputSettingsGetResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters), serviceCallback);
}
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB collection.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ThroughputSettingsGetResultsInner object
/**
* Update the RUs per second of an Azure Cosmos DB MongoDB collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB collection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ThroughputSettingsGetResultsInner object
*/
public Observable<ThroughputSettingsGetResultsInner> beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).map(new Func1<ServiceResponse<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>() {
@Override
public ThroughputSettingsGetResultsInner call(ServiceResponse<ThroughputSettingsGetResultsInner> response) {
return response.body();
}
});
}
Update the RUs per second of an Azure Cosmos DB MongoDB collection.
Params: - resourceGroupName – Name of an Azure resource group.
- accountName – Cosmos DB database account name.
- databaseName – Cosmos DB database name.
- collectionName – Cosmos DB collection name.
- updateThroughputParameters – The RUs per second of the parameters to provide for the current MongoDB collection.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ThroughputSettingsGetResultsInner object
/**
* Update the RUs per second of an Azure Cosmos DB MongoDB collection.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param collectionName Cosmos DB collection name.
* @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB collection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ThroughputSettingsGetResultsInner object
*/
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (databaseName == null) {
throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("Parameter collectionName is required and cannot be null.");
}
if (updateThroughputParameters == null) {
throw new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.");
}
Validator.validate(updateThroughputParameters);
final String apiVersion = "2019-08-01";
return service.beginUpdateMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ThroughputSettingsGetResultsInner>>>() {
@Override
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ThroughputSettingsGetResultsInner> clientResponse = beginUpdateMongoDBCollectionThroughputDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ThroughputSettingsGetResultsInner> beginUpdateMongoDBCollectionThroughputDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ThroughputSettingsGetResultsInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ThroughputSettingsGetResultsInner>() { }.getType())
.register(202, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
}