From bf98f741dd6a6743ec31a0a62b7fc94d591cb214 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 18 Nov 2020 01:07:14 +0000 Subject: [PATCH] CodeGen from PR 11609 in Azure/azure-rest-api-specs Merge 9078f9e146b0738380c86b2b845d07ecb76a9abe into 20283a103ef5216f805fccc7ace6b6fc26c0cfbd --- sdk/cosmos/mgmt-v2020_03_01/pom.xml | 4 +- .../v2020_03_01/AzureEntityResource.java | 3 +- .../CassandraKeyspaceGetResults.java | 2 +- .../v2020_03_01/CassandraResources.java | 66 +- .../v2020_03_01/CassandraTableGetResults.java | 2 +- .../CollectionPartitionRegions.java | 2 +- .../v2020_03_01/CollectionPartitions.java | 4 +- .../v2020_03_01/CollectionRegions.java | 2 +- .../cosmosdb/v2020_03_01/Collections.java | 6 +- .../DatabaseAccountGetResults.java | 5 + .../v2020_03_01/DatabaseAccountRegions.java | 2 +- .../v2020_03_01/DatabaseAccounts.java | 22 +- .../cosmosdb/v2020_03_01/Databases.java | 6 +- .../GremlinDatabaseGetResults.java | 2 +- .../v2020_03_01/GremlinGraphGetResults.java | 2 +- .../v2020_03_01/GremlinResources.java | 66 +- .../MongoDBCollectionGetResults.java | 2 +- .../MongoDBDatabaseGetResults.java | 2 +- .../v2020_03_01/MongoDBResources.java | 66 +- .../v2020_03_01/NotebookWorkspace.java | 2 +- .../v2020_03_01/NotebookWorkspaces.java | 12 +- .../PartitionKeyRangeIdRegions.java | 2 +- .../v2020_03_01/PartitionKeyRangeIds.java | 2 +- .../v2020_03_01/PercentileSourceTargets.java | 2 +- .../v2020_03_01/PercentileTargets.java | 2 +- .../cosmosdb/v2020_03_01/Percentiles.java | 2 +- .../PrivateEndpointConnection.java | 62 +- .../v2020_03_01/PrivateLinkResource.java | 5 + .../v2020_03_01/PrivateLinkResources.java | 4 +- ...ateLinkServiceConnectionStateProperty.java | 30 +- .../v2020_03_01/SqlContainerGetResults.java | 2 +- .../v2020_03_01/SqlDatabaseGetResults.java | 2 +- .../cosmosdb/v2020_03_01/SqlResources.java | 84 +- .../SqlStoredProcedureGetResults.java | 2 +- .../v2020_03_01/SqlTriggerGetResults.java | 2 +- .../SqlUserDefinedFunctionGetResults.java | 2 +- .../cosmosdb/v2020_03_01/TableGetResults.java | 2 +- .../cosmosdb/v2020_03_01/TableResources.java | 32 +- .../CassandraResourcesImpl.java | 48 + .../CassandraResourcesInner.java | 1341 +++++++++++---- .../CollectionPartitionRegionsInner.java | 8 +- .../CollectionPartitionsInner.java | 24 +- .../CollectionRegionsInner.java | 8 +- .../implementation/CollectionsInner.java | 32 +- .../CosmosDBManagementClientImpl.java | 29 +- .../DatabaseAccountGetResultsImpl.java | 13 + .../DatabaseAccountGetResultsInner.java | 16 + .../DatabaseAccountRegionsInner.java | 8 +- .../implementation/DatabaseAccountsInner.java | 193 ++- .../implementation/DatabasesInner.java | 32 +- .../implementation/GremlinResourcesImpl.java | 48 + .../implementation/GremlinResourcesInner.java | 1341 +++++++++++---- .../implementation/MongoDBResourcesImpl.java | 48 + .../implementation/MongoDBResourcesInner.java | 1341 +++++++++++---- .../implementation/NotebookWorkspaceImpl.java | 5 +- .../NotebookWorkspacesInner.java | 138 +- .../PartitionKeyRangeIdRegionsInner.java | 8 +- .../PartitionKeyRangeIdsInner.java | 8 +- .../PercentileSourceTargetsInner.java | 8 +- .../PercentileTargetsInner.java | 8 +- .../implementation/PercentilesInner.java | 8 +- .../PrivateEndpointConnectionImpl.java | 22 + .../PrivateEndpointConnectionInner.java | 52 + .../PrivateLinkResourceImpl.java | 5 + .../PrivateLinkResourceInner.java | 15 + .../PrivateLinkResourcesInner.java | 16 +- .../implementation/SqlResourcesImpl.java | 48 + .../implementation/SqlResourcesInner.java | 1485 ++++++++++++----- .../implementation/TableResourcesImpl.java | 24 + .../implementation/TableResourcesInner.java | 421 ++++- 70 files changed, 5579 insertions(+), 1741 deletions(-) diff --git a/sdk/cosmos/mgmt-v2020_03_01/pom.xml b/sdk/cosmos/mgmt-v2020_03_01/pom.xml index f6cb9eff921c0..1d750a0ced9a7 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/pom.xml +++ b/sdk/cosmos/mgmt-v2020_03_01/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.3.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-cosmosdb 1.0.0-beta diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/AzureEntityResource.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/AzureEntityResource.java index fae5de9a8e1c1..e0ef1547938e6 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/AzureEntityResource.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/AzureEntityResource.java @@ -12,7 +12,8 @@ import com.microsoft.azure.ProxyResource; /** - * The resource model definition for a Azure Resource Manager resource with an + * Entity Resource. + * The resource model definition for an Azure Resource Manager resource with an * etag. */ public class AzureEntityResource extends ProxyResource { diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraKeyspaceGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraKeyspaceGetResults.java index 40525bc28bd79..f1cbf18ddb8b7 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraKeyspaceGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraKeyspaceGetResults.java @@ -80,7 +80,7 @@ interface Blank extends WithDatabaseAccount { interface WithDatabaseAccount { /** * Specifies resourceGroupName, accountName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @return the next definition stage */ diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraResources.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraResources.java index 8557ef1b47bdb..a5c8c953a1874 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraResources.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraResources.java @@ -34,7 +34,7 @@ public interface CassandraResources { /** * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -45,7 +45,7 @@ public interface CassandraResources { /** * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -55,7 +55,7 @@ public interface CassandraResources { /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -66,7 +66,7 @@ public interface CassandraResources { /** * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -77,7 +77,7 @@ public interface CassandraResources { /** * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra Keyspace. @@ -86,10 +86,32 @@ public interface CassandraResources { */ Observable updateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName); + /** * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. @@ -101,7 +123,7 @@ public interface CassandraResources { /** * Update RUs per second of an Azure Cosmos DB Cassandra table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. @@ -111,10 +133,34 @@ public interface CassandraResources { */ Observable updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName); + /** * Gets the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. @@ -126,7 +172,7 @@ public interface CassandraResources { /** * Lists the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -137,7 +183,7 @@ public interface CassandraResources { /** * Deletes an existing Azure Cosmos DB Cassandra table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraTableGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraTableGetResults.java index 9ad374f764709..f57afd9e5029b 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraTableGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CassandraTableGetResults.java @@ -80,7 +80,7 @@ interface Blank extends WithCassandraKeyspace { interface WithCassandraKeyspace { /** * Specifies resourceGroupName, accountName, keyspaceName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @param keyspaceName Cosmos DB keyspace name * @return the next definition stage diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionPartitionRegions.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionPartitionRegions.java index 2f4334f3b601a..c07446f48e53c 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionPartitionRegions.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionPartitionRegions.java @@ -17,7 +17,7 @@ public interface CollectionPartitionRegions { /** * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionPartitions.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionPartitions.java index 92b8e7cec80b3..2de8be368c436 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionPartitions.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionPartitions.java @@ -17,7 +17,7 @@ public interface CollectionPartitions { /** * Retrieves the metrics determined by the given filter for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -30,7 +30,7 @@ public interface CollectionPartitions { /** * Retrieves the usages (most recent storage data) for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionRegions.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionRegions.java index 4b1ad3d5af9da..243d87ba6e713 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionRegions.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/CollectionRegions.java @@ -18,7 +18,7 @@ public interface CollectionRegions { /** * Retrieves the metrics determined by the given filter for the given database account, collection and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/Collections.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/Collections.java index d867cae049a40..ec5cd6a7db7c8 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/Collections.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/Collections.java @@ -20,7 +20,7 @@ public interface Collections { /** * Retrieves metric definitions for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -32,7 +32,7 @@ public interface Collections { /** * Retrieves the metrics determined by the given filter for the given database account and collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -45,7 +45,7 @@ public interface Collections { /** * Retrieves the usages (most recent storage data) for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/DatabaseAccountGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/DatabaseAccountGetResults.java index 3e915e9f79798..99d20867c54b7 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/DatabaseAccountGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/DatabaseAccountGetResults.java @@ -100,6 +100,11 @@ public interface DatabaseAccountGetResults extends HasInner locations(); + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + /** * @return the provisioningState value. */ diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/DatabaseAccountRegions.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/DatabaseAccountRegions.java index 92651e7596fc0..0162697263d9d 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/DatabaseAccountRegions.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/DatabaseAccountRegions.java @@ -19,7 +19,7 @@ public interface DatabaseAccountRegions extends HasInner updateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 + */ + Observable migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 + */ + Observable migrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName); + /** * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. @@ -101,7 +123,7 @@ public interface GremlinResources { /** * Update RUs per second of an Azure Cosmos DB Gremlin graph. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. @@ -111,10 +133,34 @@ public interface GremlinResources { */ Observable updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName); + /** * Gets the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. @@ -126,7 +172,7 @@ public interface GremlinResources { /** * Lists the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -137,7 +183,7 @@ public interface GremlinResources { /** * Deletes an existing Azure Cosmos DB Gremlin graph. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBCollectionGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBCollectionGetResults.java index 671722b3ea721..1bf7ac08180f9 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBCollectionGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBCollectionGetResults.java @@ -80,7 +80,7 @@ interface Blank extends WithMongodbDatabasis { interface WithMongodbDatabasis { /** * Specifies resourceGroupName, accountName, databaseName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @param databaseName Cosmos DB database name * @return the next definition stage diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBDatabaseGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBDatabaseGetResults.java index 2fde98e476f30..27f96d24ef2cd 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBDatabaseGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBDatabaseGetResults.java @@ -80,7 +80,7 @@ interface Blank extends WithDatabaseAccount { interface WithDatabaseAccount { /** * Specifies resourceGroupName, accountName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @return the next definition stage */ diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBResources.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBResources.java index ab3d0c2a6b71d..f5a04089d4628 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBResources.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/MongoDBResources.java @@ -34,7 +34,7 @@ public interface MongoDBResources { /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -45,7 +45,7 @@ public interface MongoDBResources { /** * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -55,7 +55,7 @@ public interface MongoDBResources { /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -66,7 +66,7 @@ public interface MongoDBResources { /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -77,7 +77,7 @@ public interface MongoDBResources { /** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -86,10 +86,32 @@ public interface MongoDBResources { */ Observable updateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 + */ + Observable migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 + */ + Observable migrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName); + /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. @@ -101,7 +123,7 @@ public interface MongoDBResources { /** * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. @@ -111,10 +133,34 @@ public interface MongoDBResources { */ Observable updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 + */ + Observable migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String collectionName); + + /** + * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 + */ + Observable migrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName); + /** * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. @@ -126,7 +172,7 @@ public interface MongoDBResources { /** * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -137,7 +183,7 @@ public interface MongoDBResources { /** * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/NotebookWorkspace.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/NotebookWorkspace.java index 0a342eed6d34c..b1464df26a662 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/NotebookWorkspace.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/NotebookWorkspace.java @@ -69,7 +69,7 @@ interface Blank extends WithDatabaseAccount { interface WithDatabaseAccount { /** * Specifies resourceGroupName, accountName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @return the next definition stage */ diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/NotebookWorkspaces.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/NotebookWorkspaces.java index e30defdd49392..121647b434bef 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/NotebookWorkspaces.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/NotebookWorkspaces.java @@ -21,7 +21,7 @@ public interface NotebookWorkspaces extends SupportsCreating { /** * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/Percentiles.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/Percentiles.java index 0cc2ae0a70e37..3a2876194db31 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/Percentiles.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/Percentiles.java @@ -19,7 +19,7 @@ public interface Percentiles extends HasInner { /** * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @throws IllegalArgumentException thrown if parameters fail the validation diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateEndpointConnection.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateEndpointConnection.java index 5b1e6771b85d6..da125104ed801 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateEndpointConnection.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateEndpointConnection.java @@ -22,6 +22,11 @@ * Type representing PrivateEndpointConnection. */ public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the groupId value. + */ + String groupId(); + /** * @return the id value. */ @@ -42,6 +47,11 @@ public interface PrivateEndpointConnection extends HasInner, DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + interface WithCreate extends Creatable, DefinitionStages.WithGroupId, DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState, DefinitionStages.WithProvisioningState { } } /** * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + interface Update extends Appliable, UpdateStages.WithGroupId, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState, UpdateStages.WithProvisioningState { } /** * Grouping of PrivateEndpointConnection update stages. */ interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify GroupId. + */ + interface WithGroupId { + /** + * Specifies groupId. + * @param groupId Group id of the private endpoint + * @return the next update stage + */ + Update withGroupId(String groupId); + } + /** * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. */ @@ -142,5 +188,17 @@ interface WithPrivateLinkServiceConnectionState { Update withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState); } + /** + * The stage of the privateendpointconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the private endpoint + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + } } diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateLinkResource.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateLinkResource.java index 1b170de7dadc9..d7e8f1fe9f009 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateLinkResource.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateLinkResource.java @@ -40,6 +40,11 @@ public interface PrivateLinkResource extends HasInner, */ List requiredMembers(); + /** + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + /** * @return the type value. */ diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateLinkResources.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateLinkResources.java index 1c2a8cbb25341..b1d561168e654 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateLinkResources.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/PrivateLinkResources.java @@ -19,7 +19,7 @@ public interface PrivateLinkResources extends HasInner updateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 + */ + Observable migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 + */ + Observable migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName); + /** * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -125,7 +147,7 @@ public interface SqlResources { /** * Update RUs per second of an Azure Cosmos DB SQL container. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -135,10 +157,34 @@ public interface SqlResources { */ Observable updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String containerName); + + /** + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName); + /** * Gets the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -150,7 +196,7 @@ public interface SqlResources { /** * Lists the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -161,7 +207,7 @@ public interface SqlResources { /** * Deletes an existing Azure Cosmos DB SQL container. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -173,7 +219,7 @@ public interface SqlResources { /** * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -186,7 +232,7 @@ public interface SqlResources { /** * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -198,7 +244,7 @@ public interface SqlResources { /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -211,7 +257,7 @@ public interface SqlResources { /** * Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -224,7 +270,7 @@ public interface SqlResources { /** * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -236,7 +282,7 @@ public interface SqlResources { /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -249,7 +295,7 @@ public interface SqlResources { /** * Gets the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -262,7 +308,7 @@ public interface SqlResources { /** * Lists the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -274,7 +320,7 @@ public interface SqlResources { /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlStoredProcedureGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlStoredProcedureGetResults.java index 85fd23f123a88..04897b5c6d927 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlStoredProcedureGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlStoredProcedureGetResults.java @@ -75,7 +75,7 @@ interface Blank extends WithContainer { interface WithContainer { /** * Specifies resourceGroupName, accountName, databaseName, containerName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @param databaseName Cosmos DB database name * @param containerName Cosmos DB container name diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlTriggerGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlTriggerGetResults.java index 434b01510d4ff..664ee05663701 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlTriggerGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlTriggerGetResults.java @@ -75,7 +75,7 @@ interface Blank extends WithContainer { interface WithContainer { /** * Specifies resourceGroupName, accountName, databaseName, containerName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @param databaseName Cosmos DB database name * @param containerName Cosmos DB container name diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlUserDefinedFunctionGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlUserDefinedFunctionGetResults.java index 93a8cfe5cd01c..5570971a3b162 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlUserDefinedFunctionGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/SqlUserDefinedFunctionGetResults.java @@ -75,7 +75,7 @@ interface Blank extends WithContainer { interface WithContainer { /** * Specifies resourceGroupName, accountName, databaseName, containerName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @param databaseName Cosmos DB database name * @param containerName Cosmos DB container name diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/TableGetResults.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/TableGetResults.java index 9525e6b76471e..ef7da6e6050f0 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/TableGetResults.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/TableGetResults.java @@ -81,7 +81,7 @@ interface Blank extends WithDatabaseAccount { interface WithDatabaseAccount { /** * Specifies resourceGroupName, accountName. - * @param resourceGroupName Name of an Azure resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param accountName Cosmos DB database account name * @return the next definition stage */ diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/TableResources.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/TableResources.java index 4b97875dc7adc..a1f5fab96cbd2 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/TableResources.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/TableResources.java @@ -26,7 +26,7 @@ public interface TableResources { /** * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -37,7 +37,7 @@ public interface TableResources { /** * Lists the Tables under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -47,7 +47,7 @@ public interface TableResources { /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -58,7 +58,7 @@ public interface TableResources { /** * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -69,7 +69,7 @@ public interface TableResources { /** * Update RUs per second of an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. @@ -78,4 +78,26 @@ public interface TableResources { */ Observable updateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable migrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName); + } diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraResourcesImpl.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraResourcesImpl.java index 97a549ca4804a..8b50decff5df1 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraResourcesImpl.java @@ -139,6 +139,30 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName) { + CassandraResourcesInner client = this.inner(); + return client.migrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName) { + CassandraResourcesInner client = this.inner(); + return client.migrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + @Override public Observable getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { CassandraResourcesInner client = this.inner(); @@ -163,6 +187,30 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable migrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + CassandraResourcesInner client = this.inner(); + return client.migrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + CassandraResourcesInner client = this.inner(); + return client.migrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + @Override public Observable getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { CassandraResourcesInner client = this.inner(); diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraResourcesInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraResourcesInner.java index bc54117afb970..e2b40db38f9fb 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraResourcesInner.java @@ -27,6 +27,7 @@ import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.Response; @@ -95,6 +96,22 @@ interface CassandraResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default") Observable> beginUpdateCassandraKeyspaceThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.v2020_03_01.CassandraResources migrateCassandraKeyspaceToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateCassandraKeyspaceToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.v2020_03_01.CassandraResources beginMigrateCassandraKeyspaceToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateCassandraKeyspaceToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.v2020_03_01.CassandraResources migrateCassandraKeyspaceToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateCassandraKeyspaceToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.v2020_03_01.CassandraResources beginMigrateCassandraKeyspaceToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateCassandraKeyspaceToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.v2020_03_01.CassandraResources listCassandraTables" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables") Observable> listCassandraTables(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -131,12 +148,28 @@ interface CassandraResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default") Observable> beginUpdateCassandraTableThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @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.v2020_03_01.CassandraResources migrateCassandraTableToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateCassandraTableToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @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.v2020_03_01.CassandraResources beginMigrateCassandraTableToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateCassandraTableToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @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.v2020_03_01.CassandraResources migrateCassandraTableToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateCassandraTableToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @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.v2020_03_01.CassandraResources beginMigrateCassandraTableToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateCassandraTableToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -150,7 +183,7 @@ public List listCassandraKeyspaces(String reso /** * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -163,7 +196,7 @@ public ServiceFuture> listCassandraKeyspa /** * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<CassandraKeyspaceGetResultsInner> object @@ -180,7 +213,7 @@ public List call(ServiceResponse> listCassandr /** * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -240,7 +273,7 @@ public CassandraKeyspaceGetResultsInner getCassandraKeyspace(String resourceGrou /** * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -254,7 +287,7 @@ public ServiceFuture getCassandraKeyspaceAsync /** * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -272,7 +305,7 @@ public CassandraKeyspaceGetResultsInner call(ServiceResponse getCassandraKeyspaceDe /** * Create or update an Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. @@ -332,7 +365,7 @@ public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String res /** * Create or update an Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. @@ -347,7 +380,7 @@ public ServiceFuture createUpdateCassandraKeys /** * Create or update an Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. @@ -366,7 +399,7 @@ public CassandraKeyspaceGetResultsInner call(ServiceResponse> createUpdat /** * Create or update an Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. @@ -414,7 +447,7 @@ public CassandraKeyspaceGetResultsInner beginCreateUpdateCassandraKeyspace(Strin /** * Create or update an Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. @@ -429,7 +462,7 @@ public ServiceFuture beginCreateUpdateCassandr /** * Create or update an Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. @@ -448,7 +481,7 @@ public CassandraKeyspaceGetResultsInner call(ServiceResponse beginCreateUpdateCassa /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -512,7 +545,7 @@ public void deleteCassandraKeyspace(String resourceGroupName, String accountName /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -526,7 +559,7 @@ public ServiceFuture deleteCassandraKeyspaceAsync(String resourceGroupName /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -544,7 +577,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -571,7 +604,7 @@ public Observable> deleteCassandraKeyspaceWithServiceRespo /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -585,7 +618,7 @@ public void beginDeleteCassandraKeyspace(String resourceGroupName, String accoun /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -599,7 +632,7 @@ public ServiceFuture beginDeleteCassandraKeyspaceAsync(String resourceGrou /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -617,7 +650,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -662,7 +695,7 @@ private ServiceResponse beginDeleteCassandraKeyspaceDelegate(Response getCassandraKeyspaceThro /** * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -709,7 +742,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse getCassandraKeyspaceT /** * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra Keyspace. @@ -769,7 +802,7 @@ public ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(Strin /** * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra Keyspace. @@ -784,7 +817,7 @@ public ServiceFuture updateCassandraKeyspaceT /** * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra Keyspace. @@ -803,7 +836,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateCass /** * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra Keyspace. @@ -851,7 +884,7 @@ public ThroughputSettingsGetResultsInner beginUpdateCassandraKeyspaceThroughput( /** * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra Keyspace. @@ -866,7 +899,7 @@ public ServiceFuture beginUpdateCassandraKeys /** * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra Keyspace. @@ -885,7 +918,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse beginUpdateCassandraK } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace 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<CassandraTableGetResultsInner> object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public List listCassandraTables(String resourceGroupName, String accountName, String keyspaceName) { - return listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName) { + return migrateCassandraKeyspaceToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().last().body(); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace 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> listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + public ServiceFuture migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateCassandraKeyspaceToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<CassandraTableGetResultsInner> object + * @return the observable for the request */ - public Observable> listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName) { - return listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1>, List>() { + public Observable migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName) { + return migrateCassandraKeyspaceToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public List call(ServiceResponse> response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<CassandraTableGetResultsInner> object + * @return the observable for the request */ - public Observable>> listCassandraTablesWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + public Observable> migrateCassandraKeyspaceToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1002,93 +1035,67 @@ public Observable>> listCass throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); } final String apiVersion = "2020-03-01"; - return service.listCassandraTables(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listCassandraTablesDelegate(response); - List items = null; - if (result.body() != null) { - items = result.body().items(); - } - ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listCassandraTablesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); + Observable> observable = service.migrateCassandraKeyspaceToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 CassandraTableGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public CassandraTableGetResultsInner getCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { - return getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName) { + return beginMigrateCassandraKeyspaceToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + public ServiceFuture beginMigrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateCassandraKeyspaceToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CassandraTableGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { - return getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, CassandraTableGetResultsInner>() { + public Observable beginMigrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName) { + return beginMigrateCassandraKeyspaceToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public CassandraTableGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CassandraTableGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable> getCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + public Observable> beginMigrateCassandraKeyspaceToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1101,16 +1108,13 @@ public Observable> getCassandraTa if (keyspaceName == null) { throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); } - if (tableName == null) { - throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); - } final String apiVersion = "2020-03-01"; - return service.getCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginMigrateCassandraKeyspaceToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getCassandraTableDelegate(response); + ServiceResponse clientResponse = beginMigrateCassandraKeyspaceToAutoscaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1119,78 +1123,71 @@ public Observable> call(Response< }); } - private ServiceResponse getCassandraTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginMigrateCassandraKeyspaceToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @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 CassandraTableGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).toBlocking().last().body(); + public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, String keyspaceName) { + return migrateCassandraKeyspaceToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().last().body(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @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 createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters), serviceCallback); + public ServiceFuture migrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateCassandraKeyspaceToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).map(new Func1, CassandraTableGetResultsInner>() { + public Observable migrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName) { + return migrateCassandraKeyspaceToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public CassandraTableGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createUpdateCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + public Observable> migrateCassandraKeyspaceToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1203,83 +1200,68 @@ public Observable> createUpdateCa if (keyspaceName == null) { throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); } - if (tableName == null) { - throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); - } - if (createUpdateCassandraTableParameters == null) { - throw new IllegalArgumentException("Parameter createUpdateCassandraTableParameters is required and cannot be null."); - } - Validator.validate(createUpdateCassandraTableParameters); final String apiVersion = "2020-03-01"; - Observable> observable = service.createUpdateCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, createUpdateCassandraTableParameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.migrateCassandraKeyspaceToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @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 CassandraTableGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public CassandraTableGetResultsInner beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, String keyspaceName) { + return beginMigrateCassandraKeyspaceToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @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 beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters), serviceCallback); + public ServiceFuture beginMigrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateCassandraKeyspaceToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CassandraTableGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).map(new Func1, CassandraTableGetResultsInner>() { + public Observable beginMigrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName) { + return beginMigrateCassandraKeyspaceToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public CassandraTableGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CassandraTableGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable> beginCreateUpdateCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + public Observable> beginMigrateCassandraKeyspaceToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1292,20 +1274,13 @@ public Observable> beginCreateUpd if (keyspaceName == null) { throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); } - if (tableName == null) { - throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); - } - if (createUpdateCassandraTableParameters == null) { - throw new IllegalArgumentException("Parameter createUpdateCassandraTableParameters is required and cannot be null."); - } - Validator.validate(createUpdateCassandraTableParameters); final String apiVersion = "2020-03-01"; - return service.beginCreateUpdateCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, createUpdateCassandraTableParameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginMigrateCassandraKeyspaceToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateUpdateCassandraTableDelegate(response); + ServiceResponse clientResponse = beginMigrateCassandraKeyspaceToManualThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1314,74 +1289,71 @@ public Observable> call(Response< }); } - private ServiceResponse beginCreateUpdateCassandraTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginMigrateCassandraKeyspaceToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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<CassandraTableGetResultsInner> object if successful. */ - public void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { - deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().last().body(); + public List listCassandraTables(String resourceGroupName, String accountName, String keyspaceName) { + return listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + public ServiceFuture> listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<CassandraTableGetResultsInner> object */ - public Observable deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { - return deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, Void>() { + public Observable> listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName) { + return listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1>, List>() { @Override - public Void call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<CassandraTableGetResultsInner> object */ - public Observable> deleteCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + public Observable>> listCassandraTablesWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1394,33 +1366,53 @@ public Observable> deleteCassandraTableWithServiceResponse if (keyspaceName == null) { throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); } - if (tableName == null) { - throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); - } final String apiVersion = "2020-03-01"; - Observable> observable = service.deleteCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return service.listCassandraTables(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCassandraTablesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listCassandraTablesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Gets the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table 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 CassandraTableGetResultsInner object if successful. */ - public void beginDeleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { - beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + public CassandraTableGetResultsInner getCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Gets the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. @@ -1428,40 +1420,614 @@ public void beginDeleteCassandraTable(String resourceGroupName, String accountNa * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + public ServiceFuture getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Gets the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the CassandraTableGetResultsInner object */ - public Observable beginDeleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { - return beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, Void>() { + public Observable getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, CassandraTableGetResultsInner>() { @Override - public Void call(ServiceResponse response) { + public CassandraTableGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Gets the Cassandra table under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the CassandraTableGetResultsInner object */ - public Observable> beginDeleteCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + public Observable> getCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.getCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCassandraTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCassandraTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 CassandraTableGetResultsInner object if successful. + */ + public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).map(new Func1, CassandraTableGetResultsInner>() { + @Override + public CassandraTableGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + 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 (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (createUpdateCassandraTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraTableParameters); + final String apiVersion = "2020-03-01"; + Observable> observable = service.createUpdateCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, createUpdateCassandraTableParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 CassandraTableGetResultsInner object if successful. + */ + public CassandraTableGetResultsInner beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraTableGetResultsInner object + */ + public Observable beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).map(new Func1, CassandraTableGetResultsInner>() { + @Override + public CassandraTableGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraTableGetResultsInner object + */ + public Observable> beginCreateUpdateCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + 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 (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (createUpdateCassandraTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraTableParameters); + final String apiVersion = "2020-03-01"; + return service.beginCreateUpdateCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, createUpdateCassandraTableParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateCassandraTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateCassandraTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + Observable> observable = service.deleteCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 beginDeleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 beginDeleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.beginDeleteCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteCassandraTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteCassandraTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 getCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + } + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable> getCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.getCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCassandraTableThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCassandraTableThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. + * @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 updateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. + * @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 updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1477,13 +2043,106 @@ public Observable> beginDeleteCassandraTableWithServiceRes if (tableName == null) { throw new IllegalArgumentException("Parameter tableName 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 = "2020-03-01"; - return service.beginDeleteCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Observable> observable = service.updateCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. + * @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 beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. + * @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 beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable> beginUpdateCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, 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 (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 = "2020-03-01"; + return service.beginUpdateCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteCassandraTableDelegate(response); + ServiceResponse clientResponse = beginUpdateCassandraTableThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1492,18 +2151,18 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteCassandraTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginUpdateCassandraTableThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. @@ -1512,14 +2171,14 @@ private ServiceResponse beginDeleteCassandraTableDelegate(Response getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + public ServiceFuture migrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateCassandraTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); } /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable migrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return migrateCassandraTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> migrateCassandraTableToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + Observable> observable = service.migrateCassandraTableToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return beginMigrateCassandraTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 beginMigrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateCassandraTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + } + + /** + * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { - return getCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable beginMigrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return beginMigrateCassandraTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1551,16 +2291,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> getCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + public Observable> beginMigrateCassandraTableToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1577,12 +2317,12 @@ public Observable> getCassand throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); } final String apiVersion = "2020-03-01"; - return service.getCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginMigrateCassandraTableToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getCassandraTableThroughputDelegate(response); + ServiceResponse clientResponse = beginMigrateCassandraTableToAutoscaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1591,59 +2331,57 @@ public Observable> call(Respo }); } - private ServiceResponse getCassandraTableThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginMigrateCassandraTableToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. * @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 updateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).toBlocking().last().body(); + public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return migrateCassandraTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().last().body(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. * @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 updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters), serviceCallback); + public ServiceFuture migrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateCassandraTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable migrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return migrateCassandraTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1652,17 +2390,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Observable> migrateCassandraTableToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1678,61 +2415,54 @@ public Observable> updateCass if (tableName == null) { throw new IllegalArgumentException("Parameter tableName 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 = "2020-03-01"; - Observable> observable = service.updateCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.migrateCassandraTableToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. * @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 beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return beginMigrateCassandraTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. * @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 beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters), serviceCallback); + public ServiceFuture beginMigrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateCassandraTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra table. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable beginMigrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return beginMigrateCassandraTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1741,17 +2471,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> beginUpdateCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Observable> beginMigrateCassandraTableToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1767,17 +2496,13 @@ public Observable> beginUpdat if (tableName == null) { throw new IllegalArgumentException("Parameter tableName 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 = "2020-03-01"; - return service.beginUpdateCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginMigrateCassandraTableToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginUpdateCassandraTableThroughputDelegate(response); + ServiceResponse clientResponse = beginMigrateCassandraTableToManualThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1786,7 +2511,7 @@ public Observable> call(Respo }); } - private ServiceResponse beginUpdateCassandraTableThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginMigrateCassandraTableToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionPartitionRegionsInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionPartitionRegionsInner.java index 28bf1651cc1c3..e391e7fd7b247 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionPartitionRegionsInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionPartitionRegionsInner.java @@ -61,7 +61,7 @@ interface CollectionPartitionRegionsService { /** * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -79,7 +79,7 @@ public List listMetrics(String resourceGroupName, String a /** * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -96,7 +96,7 @@ public ServiceFuture> listMetricsAsync(String resourc /** * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -117,7 +117,7 @@ public List call(ServiceResponse listMetrics(String resourceGroupName, String a /** * Retrieves the metrics determined by the given filter for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -98,7 +98,7 @@ public ServiceFuture> listMetricsAsync(String resourc /** * Retrieves the metrics determined by the given filter for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -118,7 +118,7 @@ public List call(ServiceResponse> listMetricsDelegate(Resp /** * Retrieves the usages (most recent storage data) for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -191,7 +191,7 @@ public List listUsages(String resourceGroupName, String acc /** * Retrieves the usages (most recent storage data) for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -206,7 +206,7 @@ public ServiceFuture> listUsagesAsync(String resourceG /** * Retrieves the usages (most recent storage data) for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -225,7 +225,7 @@ public List call(ServiceResponse> /** * Retrieves the usages (most recent storage data) for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -272,7 +272,7 @@ public Observable>> call(Response listUsages(String resourceGroupName, String acc /** * Retrieves the usages (most recent storage data) for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -305,7 +305,7 @@ public ServiceFuture> listUsagesAsync(String resourceG /** * Retrieves the usages (most recent storage data) for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -325,7 +325,7 @@ public List call(ServiceResponse> /** * Retrieves the usages (most recent storage data) for the given collection, split by partition. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionRegionsInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionRegionsInner.java index fac223c466d7a..e16f7dfdcd777 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionRegionsInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionRegionsInner.java @@ -61,7 +61,7 @@ interface CollectionRegionsService { /** * Retrieves the metrics determined by the given filter for the given database account, collection and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -79,7 +79,7 @@ public List listMetrics(String resourceGroupName, String accountNam /** * Retrieves the metrics determined by the given filter for the given database account, collection and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -96,7 +96,7 @@ public ServiceFuture> listMetricsAsync(String resourceGroupNam /** * Retrieves the metrics determined by the given filter for the given database account, collection and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -117,7 +117,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the metrics determined by the given filter for the given database account, collection and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionsInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionsInner.java index 03c91517cf335..af2141a6cd3f0 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionsInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CollectionsInner.java @@ -69,7 +69,7 @@ interface CollectionsService { /** * Retrieves the metrics determined by the given filter for the given database account and collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -86,7 +86,7 @@ public List listMetrics(String resourceGroupName, String accountNam /** * Retrieves the metrics determined by the given filter for the given database account and collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -102,7 +102,7 @@ public ServiceFuture> listMetricsAsync(String resourceGroupNam /** * Retrieves the metrics determined by the given filter for the given database account and collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -122,7 +122,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the metrics determined by the given filter for the given database account and collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -179,7 +179,7 @@ private ServiceResponse> listMetricsDelegate(Response listUsages(String resourceGroupName, String accountName, /** * Retrieves the usages (most recent storage data) for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -210,7 +210,7 @@ public ServiceFuture> listUsagesAsync(String resourceGroupName, /** * Retrieves the usages (most recent storage data) for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -229,7 +229,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the usages (most recent storage data) for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -276,7 +276,7 @@ public Observable>> call(Response /** * Retrieves the usages (most recent storage data) for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -293,7 +293,7 @@ public List listUsages(String resourceGroupName, String accountName, /** * Retrieves the usages (most recent storage data) for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -309,7 +309,7 @@ public ServiceFuture> listUsagesAsync(String resourceGroupName, /** * Retrieves the usages (most recent storage data) for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -329,7 +329,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the usages (most recent storage data) for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -383,7 +383,7 @@ private ServiceResponse> listUsagesDelegate(Response listMetricDefinitions(String resourceGroupNam /** * Retrieves metric definitions for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -414,7 +414,7 @@ public ServiceFuture> listMetricDefinitionsAsync(Str /** * Retrieves metric definitions for the given collection. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -433,7 +433,7 @@ public List call(ServiceResponse locations() { return this.inner().locations(); } + @Override + public List privateEndpointConnections() { + List lst = new ArrayList(); + if (this.inner().privateEndpointConnections() != null) { + for (PrivateEndpointConnectionInner inner : this.inner().privateEndpointConnections()) { + lst.add( new PrivateEndpointConnectionImpl(inner, manager())); + } + } + return lst; + } + @Override public String provisioningState() { return this.inner().provisioningState(); diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountGetResultsInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountGetResultsInner.java index 58c3fc3360dc1..3173c7b6f2a4c 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountGetResultsInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountGetResultsInner.java @@ -122,6 +122,13 @@ public class DatabaseAccountGetResultsInner extends ARMResourceProperties { @JsonProperty(value = "properties.virtualNetworkRules") private List virtualNetworkRules; + /** + * List of Private Endpoint Connections configured for the Cosmos DB + * account. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + /** * Enables the account to write in multiple locations. */ @@ -375,6 +382,15 @@ public DatabaseAccountGetResultsInner withVirtualNetworkRules(List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Get enables the account to write in multiple locations. * diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountRegionsInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountRegionsInner.java index 84062f6c268a3..a3f1255ded15b 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountRegionsInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountRegionsInner.java @@ -61,7 +61,7 @@ interface DatabaseAccountRegionsService { /** * Retrieves the metrics determined by the given filter for the given database account and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -77,7 +77,7 @@ public List listMetrics(String resourceGroupName, String accountNam /** * Retrieves the metrics determined by the given filter for the given database account and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -92,7 +92,7 @@ public ServiceFuture> listMetricsAsync(String resourceGroupNam /** * Retrieves the metrics determined by the given filter for the given database account and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -111,7 +111,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the metrics determined by the given filter for the given database account and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountsInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountsInner.java index 014af8bd0b7db..3ae3684d818d2 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountsInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/DatabaseAccountsInner.java @@ -177,7 +177,7 @@ interface DatabaseAccountsService { /** * Retrieves the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -191,7 +191,7 @@ public DatabaseAccountGetResultsInner getByResourceGroup(String resourceGroupNam /** * Retrieves the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -204,7 +204,7 @@ public ServiceFuture getByResourceGroupAsync(Str /** * Retrieves the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountGetResultsInner object @@ -221,7 +221,7 @@ public DatabaseAccountGetResultsInner call(ServiceResponse> call(Response private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .register(404, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -262,7 +261,7 @@ private ServiceResponse getByResourceGroupDelega /** * Updates the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -277,7 +276,7 @@ public DatabaseAccountGetResultsInner update(String resourceGroupName, String ac /** * Updates the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -291,7 +290,7 @@ public ServiceFuture updateAsync(String resource /** * Updates the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -309,7 +308,7 @@ public DatabaseAccountGetResultsInner call(ServiceResponse> updateWithSer /** * Updates the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -352,7 +351,7 @@ public DatabaseAccountGetResultsInner beginUpdate(String resourceGroupName, Stri /** * Updates the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -366,7 +365,7 @@ public ServiceFuture beginUpdateAsync(String res /** * Updates the properties of an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -384,7 +383,7 @@ public DatabaseAccountGetResultsInner call(ServiceResponse beginUpdateDelegate(Resp /** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -444,7 +443,7 @@ public DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, S /** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -458,7 +457,7 @@ public ServiceFuture createOrUpdateAsync(String /** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -476,7 +475,7 @@ public DatabaseAccountGetResultsInner call(ServiceResponse> createOrUpdat /** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -519,7 +518,7 @@ public DatabaseAccountGetResultsInner beginCreateOrUpdate(String resourceGroupNa /** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -533,7 +532,7 @@ public ServiceFuture beginCreateOrUpdateAsync(St /** * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -551,7 +550,7 @@ public DatabaseAccountGetResultsInner call(ServiceResponse beginCreateOrUpdateDeleg /** * Deletes an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -609,7 +608,7 @@ public void delete(String resourceGroupName, String accountName) { /** * Deletes an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -622,7 +621,7 @@ public ServiceFuture deleteAsync(String resourceGroupName, String accountN /** * Deletes an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -639,7 +638,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -662,7 +661,7 @@ public Observable> deleteWithServiceResponseAsync(String r /** * Deletes an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -675,7 +674,7 @@ public void beginDelete(String resourceGroupName, String accountName) { /** * Deletes an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -688,7 +687,7 @@ public ServiceFuture beginDeleteAsync(String resourceGroupName, String acc /** * Deletes an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -705,7 +704,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -746,7 +745,7 @@ private ServiceResponse beginDeleteDelegate(Response respons /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -760,7 +759,7 @@ public void failoverPriorityChange(String resourceGroupName, String accountName, /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -774,7 +773,7 @@ public ServiceFuture failoverPriorityChangeAsync(String resourceGroupName, /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -792,7 +791,7 @@ public Void call(ServiceResponse response) { /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -822,7 +821,7 @@ public Observable> failoverPriorityChangeWithServiceRespon /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -836,7 +835,7 @@ public void beginFailoverPriorityChange(String resourceGroupName, String account /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -850,7 +849,7 @@ public ServiceFuture beginFailoverPriorityChangeAsync(String resourceGroup /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -868,7 +867,7 @@ public Void call(ServiceResponse response) { /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param failoverPolicies List of failover policies. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -995,7 +994,7 @@ private ServiceResponse> listDelegate(R /** * Lists all the Azure Cosmos DB database accounts available under the given resource group. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the PagedList object if successful. */ public PagedList listByResourceGroup(String resourceGroupName) { @@ -1013,7 +1012,7 @@ public Page nextPage(String nextPageLink) { /** * Lists all the Azure Cosmos DB database accounts available under the given resource group. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceFuture} object */ @@ -1024,7 +1023,7 @@ public ServiceFuture> listByResourceGroupAs /** * Lists all the Azure Cosmos DB database accounts available under the given resource group. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the observable to the List<DatabaseAccountGetResultsInner> object */ public Observable> listByResourceGroupAsync(String resourceGroupName) { @@ -1041,7 +1040,7 @@ public Page call(ServiceResponse>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { @@ -1081,7 +1080,7 @@ private ServiceResponse> listByResource /** * Lists the access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -1095,7 +1094,7 @@ public DatabaseAccountListKeysResultInner listKeys(String resourceGroupName, Str /** * Lists the access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -1108,7 +1107,7 @@ public ServiceFuture listKeysAsync(String re /** * Lists the access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListKeysResultInner object @@ -1125,7 +1124,7 @@ public DatabaseAccountListKeysResultInner call(ServiceResponse listKeysDelegate(Res /** * Lists the connection strings for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -1179,7 +1178,7 @@ public DatabaseAccountListConnectionStringsResultInner listConnectionStrings(Str /** * Lists the connection strings for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -1192,7 +1191,7 @@ public ServiceFuture listConnec /** * Lists the connection strings for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListConnectionStringsResultInner object @@ -1209,7 +1208,7 @@ public DatabaseAccountListConnectionStringsResultInner call(ServiceResponse listCon /** * Offline the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1263,7 +1262,7 @@ public void offlineRegion(String resourceGroupName, String accountName, String r /** * Offline the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -1277,7 +1276,7 @@ public ServiceFuture offlineRegionAsync(String resourceGroupName, String a /** * Offline the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1295,7 +1294,7 @@ public Void call(ServiceResponse response) { /** * Offline the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1324,7 +1323,7 @@ public Observable> offlineRegionWithServiceResponseAsync(S /** * Offline the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1338,7 +1337,7 @@ public void beginOfflineRegion(String resourceGroupName, String accountName, Str /** * Offline the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -1352,7 +1351,7 @@ public ServiceFuture beginOfflineRegionAsync(String resourceGroupName, Str /** * Offline the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1370,7 +1369,7 @@ public Void call(ServiceResponse response) { /** * Offline the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1417,7 +1416,7 @@ private ServiceResponse beginOfflineRegionDelegate(Response /** * Online the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1431,7 +1430,7 @@ public void onlineRegion(String resourceGroupName, String accountName, String re /** * Online the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -1445,7 +1444,7 @@ public ServiceFuture onlineRegionAsync(String resourceGroupName, String ac /** * Online the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1463,7 +1462,7 @@ public Void call(ServiceResponse response) { /** * Online the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1492,7 +1491,7 @@ public Observable> onlineRegionWithServiceResponseAsync(St /** * Online the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1506,7 +1505,7 @@ public void beginOnlineRegion(String resourceGroupName, String accountName, Stri /** * Online the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -1520,7 +1519,7 @@ public ServiceFuture beginOnlineRegionAsync(String resourceGroupName, Stri /** * Online the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1538,7 +1537,7 @@ public Void call(ServiceResponse response) { /** * Online the specified region for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1585,7 +1584,7 @@ private ServiceResponse beginOnlineRegionDelegate(Response r /** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -1599,7 +1598,7 @@ public DatabaseAccountListReadOnlyKeysResultInner getReadOnlyKeys(String resourc /** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -1612,7 +1611,7 @@ public ServiceFuture getReadOnlyKeys /** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object @@ -1629,7 +1628,7 @@ public DatabaseAccountListReadOnlyKeysResultInner call(ServiceResponse getReadOnlyK /** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -1683,7 +1682,7 @@ public DatabaseAccountListReadOnlyKeysResultInner listReadOnlyKeys(String resour /** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -1696,7 +1695,7 @@ public ServiceFuture listReadOnlyKey /** * Lists the read-only access keys for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object @@ -1713,7 +1712,7 @@ public DatabaseAccountListReadOnlyKeysResultInner call(ServiceResponse listReadOnly /** * Regenerates an access key for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1767,7 +1766,7 @@ public void regenerateKey(String resourceGroupName, String accountName, KeyKind /** * Regenerates an access key for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -1781,7 +1780,7 @@ public ServiceFuture regenerateKeyAsync(String resourceGroupName, String a /** * Regenerates an access key for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1799,7 +1798,7 @@ public Void call(ServiceResponse response) { /** * Regenerates an access key for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1828,7 +1827,7 @@ public Observable> regenerateKeyWithServiceResponseAsync(S /** * Regenerates an access key for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1842,7 +1841,7 @@ public void beginRegenerateKey(String resourceGroupName, String accountName, Key /** * Regenerates an access key for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -1856,7 +1855,7 @@ public ServiceFuture beginRegenerateKeyAsync(String resourceGroupName, Str /** * Regenerates an access key for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1874,7 +1873,7 @@ public Void call(ServiceResponse response) { /** * Regenerates an access key for the specified Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1996,7 +1995,7 @@ private ServiceResponse checkNameExistsDelegate(Response response /** * Retrieves the metrics determined by the given filter for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -2011,7 +2010,7 @@ public List listMetrics(String resourceGroupName, String accountNam /** * Retrieves the metrics determined by the given filter for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -2025,7 +2024,7 @@ public ServiceFuture> listMetricsAsync(String resourceGroupNam /** * Retrieves the metrics determined by the given filter for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -2043,7 +2042,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the metrics determined by the given filter for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -2092,7 +2091,7 @@ private ServiceResponse> listMetricsDelegate(Response listUsages(String resourceGroupName, String accountName) /** * Retrieves the usages (most recent data) for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -2119,7 +2118,7 @@ public ServiceFuture> listUsagesAsync(String resourceGroupName, /** * Retrieves the usages (most recent data) for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<UsageInner> object @@ -2136,7 +2135,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the usages (most recent data) for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<UsageInner> object @@ -2175,7 +2174,7 @@ public Observable>> call(Response /** * Retrieves the usages (most recent data) for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation @@ -2190,7 +2189,7 @@ public List listUsages(String resourceGroupName, String accountName, /** * Retrieves the usages (most recent data) for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -2204,7 +2203,7 @@ public ServiceFuture> listUsagesAsync(String resourceGroupName, /** * Retrieves the usages (most recent data) for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation @@ -2222,7 +2221,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the usages (most recent data) for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation @@ -2268,7 +2267,7 @@ private ServiceResponse> listUsagesDelegate(Response listMetricDefinitions(String resourceGroupNam /** * Retrieves metric definitions for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -2295,7 +2294,7 @@ public ServiceFuture> listMetricDefinitionsAsync(Str /** * Retrieves metric definitions for the given database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<MetricDefinitionInner> object @@ -2312,7 +2311,7 @@ public List call(ServiceResponse listMetrics(String resourceGroupName, String accountNam /** * Retrieves the metrics determined by the given filter for the given database account and database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -100,7 +100,7 @@ public ServiceFuture> listMetricsAsync(String resourceGroupNam /** * Retrieves the metrics determined by the given filter for the given database account and database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -119,7 +119,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the metrics determined by the given filter for the given database account and database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -172,7 +172,7 @@ private ServiceResponse> listMetricsDelegate(Response listUsages(String resourceGroupName, String accountName, /** * Retrieves the usages (most recent data) for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -201,7 +201,7 @@ public ServiceFuture> listUsagesAsync(String resourceGroupName, /** * Retrieves the usages (most recent data) for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -219,7 +219,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the usages (most recent data) for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -262,7 +262,7 @@ public Observable>> call(Response /** * Retrieves the usages (most recent data) for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -278,7 +278,7 @@ public List listUsages(String resourceGroupName, String accountName, /** * Retrieves the usages (most recent data) for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -293,7 +293,7 @@ public ServiceFuture> listUsagesAsync(String resourceGroupName, /** * Retrieves the usages (most recent data) for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -312,7 +312,7 @@ public List call(ServiceResponse> response) { /** * Retrieves the usages (most recent data) for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -362,7 +362,7 @@ private ServiceResponse> listUsagesDelegate(Response listMetricDefinitions(String resourceGroupNam /** * Retrieves metric definitions for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -391,7 +391,7 @@ public ServiceFuture> listMetricDefinitionsAsync(Str /** * Retrieves metric definitions for the given database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -409,7 +409,7 @@ public List call(ServiceResponse migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + GremlinResourcesInner client = this.inner(); + return client.migrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + GremlinResourcesInner client = this.inner(); + return client.migrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + @Override public Observable getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { GremlinResourcesInner client = this.inner(); @@ -163,6 +187,30 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + GremlinResourcesInner client = this.inner(); + return client.migrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + GremlinResourcesInner client = this.inner(); + return client.migrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + @Override public Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { GremlinResourcesInner client = this.inner(); diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/GremlinResourcesInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/GremlinResourcesInner.java index c6c784a585325..115b3771da5f0 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/GremlinResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/GremlinResourcesInner.java @@ -27,6 +27,7 @@ import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.Response; @@ -95,6 +96,22 @@ interface GremlinResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default") Observable> beginUpdateGremlinDatabaseThroughput(@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.v2020_03_01.GremlinResources migrateGremlinDatabaseToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateGremlinDatabaseToAutoscale(@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.v2020_03_01.GremlinResources beginMigrateGremlinDatabaseToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateGremlinDatabaseToAutoscale(@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.v2020_03_01.GremlinResources migrateGremlinDatabaseToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateGremlinDatabaseToManualThroughput(@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.v2020_03_01.GremlinResources beginMigrateGremlinDatabaseToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateGremlinDatabaseToManualThroughput(@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.v2020_03_01.GremlinResources listGremlinGraphs" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs") Observable> listGremlinGraphs(@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); @@ -131,12 +148,28 @@ interface GremlinResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default") Observable> beginUpdateGremlinGraphThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @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.v2020_03_01.GremlinResources migrateGremlinGraphToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateGremlinGraphToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @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.v2020_03_01.GremlinResources beginMigrateGremlinGraphToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateGremlinGraphToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @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.v2020_03_01.GremlinResources migrateGremlinGraphToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateGremlinGraphToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @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.v2020_03_01.GremlinResources beginMigrateGremlinGraphToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateGremlinGraphToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** * Lists the Gremlin databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -150,7 +183,7 @@ public List listGremlinDatabases(String resource /** * Lists the Gremlin databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -163,7 +196,7 @@ public ServiceFuture> listGremlinDatabasesA /** * Lists the Gremlin databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<GremlinDatabaseGetResultsInner> object @@ -180,7 +213,7 @@ public List call(ServiceResponse> listGremlinDat /** * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -240,7 +273,7 @@ public GremlinDatabaseGetResultsInner getGremlinDatabase(String resourceGroupNam /** * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -254,7 +287,7 @@ public ServiceFuture getGremlinDatabaseAsync(Str /** * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -272,7 +305,7 @@ public GremlinDatabaseGetResultsInner call(ServiceResponse getGremlinDatabaseDelega /** * Create or update an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. @@ -332,7 +365,7 @@ public GremlinDatabaseGetResultsInner createUpdateGremlinDatabase(String resourc /** * Create or update an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. @@ -347,7 +380,7 @@ public ServiceFuture createUpdateGremlinDatabase /** * Create or update an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. @@ -366,7 +399,7 @@ public GremlinDatabaseGetResultsInner call(ServiceResponse> createUpdateG /** * Create or update an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. @@ -414,7 +447,7 @@ public GremlinDatabaseGetResultsInner beginCreateUpdateGremlinDatabase(String re /** * Create or update an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. @@ -429,7 +462,7 @@ public ServiceFuture beginCreateUpdateGremlinDat /** * Create or update an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. @@ -448,7 +481,7 @@ public GremlinDatabaseGetResultsInner call(ServiceResponse beginCreateUpdateGremlin /** * Deletes an existing Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -512,7 +545,7 @@ public void deleteGremlinDatabase(String resourceGroupName, String accountName, /** * Deletes an existing Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -526,7 +559,7 @@ public ServiceFuture deleteGremlinDatabaseAsync(String resourceGroupName, /** * Deletes an existing Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -544,7 +577,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -571,7 +604,7 @@ public Observable> deleteGremlinDatabaseWithServiceRespons /** * Deletes an existing Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -585,7 +618,7 @@ public void beginDeleteGremlinDatabase(String resourceGroupName, String accountN /** * Deletes an existing Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -599,7 +632,7 @@ public ServiceFuture beginDeleteGremlinDatabaseAsync(String resourceGroupN /** * Deletes an existing Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -617,7 +650,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -662,7 +695,7 @@ private ServiceResponse beginDeleteGremlinDatabaseDelegate(Response getGremlinDatabaseThroug /** * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -709,7 +742,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse getGremlinDatabaseThr /** * Update RUs per second of an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 Gremlin database. @@ -769,7 +802,7 @@ public ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String /** * Update RUs per second of an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 Gremlin database. @@ -784,7 +817,7 @@ public ServiceFuture updateGremlinDatabaseThr /** * Update RUs per second of an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 Gremlin database. @@ -803,7 +836,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateGrem /** * Update RUs per second of an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 Gremlin database. @@ -851,7 +884,7 @@ public ThroughputSettingsGetResultsInner beginUpdateGremlinDatabaseThroughput(St /** * Update RUs per second of an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 Gremlin database. @@ -866,7 +899,7 @@ public ServiceFuture beginUpdateGremlinDataba /** * Update RUs per second of an Azure Cosmos DB Gremlin database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 Gremlin database. @@ -885,7 +918,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse beginUpdateGremlinDat } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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<GremlinGraphGetResultsInner> object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public List listGremlinGraphs(String resourceGroupName, String accountName, String databaseName) { - return listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return migrateGremlinDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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> listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + public ServiceFuture migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateGremlinDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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<GremlinGraphGetResultsInner> object + * @return the observable for the request */ - public Observable> listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName) { - return listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + public Observable migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + return migrateGremlinDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public List call(ServiceResponse> response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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<GremlinGraphGetResultsInner> object + * @return the observable for the request */ - public Observable>> listGremlinGraphsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + public Observable> migrateGremlinDatabaseToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1002,93 +1035,67 @@ public Observable>> listGremli throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } final String apiVersion = "2020-03-01"; - return service.listGremlinGraphs(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listGremlinGraphsDelegate(response); - List items = null; - if (result.body() != null) { - items = result.body().items(); - } - ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listGremlinGraphsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); + Observable> observable = service.migrateGremlinDatabaseToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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 GremlinGraphGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public GremlinGraphGetResultsInner getGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { - return getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateGremlinDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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 getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + public ServiceFuture beginMigrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateGremlinDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the GremlinGraphGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { - return getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, GremlinGraphGetResultsInner>() { + public Observable beginMigrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateGremlinDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public GremlinGraphGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the GremlinGraphGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable> getGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + public Observable> beginMigrateGremlinDatabaseToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1101,16 +1108,13 @@ public Observable> getGremlinGraphW if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (graphName == null) { - throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); - } final String apiVersion = "2020-03-01"; - return service.getGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginMigrateGremlinDatabaseToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getGremlinGraphDelegate(response); + ServiceResponse clientResponse = beginMigrateGremlinDatabaseToAutoscaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1119,78 +1123,71 @@ public Observable> call(Response getGremlinGraphDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginMigrateGremlinDatabaseToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 GremlinGraphGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - return createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).toBlocking().last().body(); + public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) { + return migrateGremlinDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters), serviceCallback); + public ServiceFuture migrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateGremlinDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - return createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).map(new Func1, GremlinGraphGetResultsInner>() { + public Observable migrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return migrateGremlinDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public GremlinGraphGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createUpdateGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + public Observable> migrateGremlinDatabaseToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1203,83 +1200,68 @@ public Observable> createUpdateGrem if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (graphName == null) { - throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); - } - if (createUpdateGremlinGraphParameters == null) { - throw new IllegalArgumentException("Parameter createUpdateGremlinGraphParameters is required and cannot be null."); - } - Validator.validate(createUpdateGremlinGraphParameters); final String apiVersion = "2020-03-01"; - Observable> observable = service.createUpdateGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, createUpdateGremlinGraphParameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.migrateGremlinDatabaseToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 GremlinGraphGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public GremlinGraphGetResultsInner beginCreateUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - return beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateGremlinDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters), serviceCallback); + public ServiceFuture beginMigrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateGremlinDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the GremlinGraphGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - return beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).map(new Func1, GremlinGraphGetResultsInner>() { + public Observable beginMigrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateGremlinDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public GremlinGraphGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the GremlinGraphGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable> beginCreateUpdateGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + public Observable> beginMigrateGremlinDatabaseToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1292,20 +1274,13 @@ public Observable> beginCreateUpdat if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (graphName == null) { - throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); - } - if (createUpdateGremlinGraphParameters == null) { - throw new IllegalArgumentException("Parameter createUpdateGremlinGraphParameters is required and cannot be null."); - } - Validator.validate(createUpdateGremlinGraphParameters); final String apiVersion = "2020-03-01"; - return service.beginCreateUpdateGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, createUpdateGremlinGraphParameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginMigrateGremlinDatabaseToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateUpdateGremlinGraphDelegate(response); + ServiceResponse clientResponse = beginMigrateGremlinDatabaseToManualThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1314,74 +1289,71 @@ public Observable> call(Response beginCreateUpdateGremlinGraphDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginMigrateGremlinDatabaseToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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<GremlinGraphGetResultsInner> object if successful. */ - public void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { - deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().last().body(); + public List listGremlinGraphs(String resourceGroupName, String accountName, String databaseName) { + return listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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 deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + public ServiceFuture> listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<GremlinGraphGetResultsInner> object */ - public Observable deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { - return deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, Void>() { + public Observable> listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName) { + return listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { @Override - public Void call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<GremlinGraphGetResultsInner> object */ - public Observable> deleteGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + public Observable>> listGremlinGraphsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1394,33 +1366,53 @@ public Observable> deleteGremlinGraphWithServiceResponseAs if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (graphName == null) { - throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); - } final String apiVersion = "2020-03-01"; - Observable> observable = service.deleteGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return service.listGremlinGraphs(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGremlinGraphsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGremlinGraphsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph 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 GremlinGraphGetResultsInner object if successful. */ - public void beginDeleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { - beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + public GremlinGraphGetResultsInner getGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. @@ -1428,40 +1420,614 @@ public void beginDeleteGremlinGraph(String resourceGroupName, String accountName * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + public ServiceFuture getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the GremlinGraphGetResultsInner object */ - public Observable beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { - return beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, Void>() { + public Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, GremlinGraphGetResultsInner>() { @Override - public Void call(ServiceResponse response) { + public GremlinGraphGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the GremlinGraphGetResultsInner object */ - public Observable> beginDeleteGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + public Observable> getGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (graphName == null) { + throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.getGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGremlinGraphDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGremlinGraphDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 GremlinGraphGetResultsInner object if successful. + */ + public GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).map(new Func1, GremlinGraphGetResultsInner>() { + @Override + public GremlinGraphGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + 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 (graphName == null) { + throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); + } + if (createUpdateGremlinGraphParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinGraphParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinGraphParameters); + final String apiVersion = "2020-03-01"; + Observable> observable = service.createUpdateGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, createUpdateGremlinGraphParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 GremlinGraphGetResultsInner object if successful. + */ + public GremlinGraphGetResultsInner beginCreateUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinGraphGetResultsInner object + */ + public Observable beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).map(new Func1, GremlinGraphGetResultsInner>() { + @Override + public GremlinGraphGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinGraphGetResultsInner object + */ + public Observable> beginCreateUpdateGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + 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 (graphName == null) { + throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); + } + if (createUpdateGremlinGraphParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinGraphParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinGraphParameters); + final String apiVersion = "2020-03-01"; + return service.beginCreateUpdateGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, createUpdateGremlinGraphParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateGremlinGraphDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateGremlinGraphDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { + deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (graphName == null) { + throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + Observable> observable = service.deleteGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 beginDeleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { + beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (graphName == null) { + throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.beginDeleteGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteGremlinGraphDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteGremlinGraphDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 getGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + } + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + } + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable> getGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (graphName == null) { + throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.getGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGremlinGraphThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGremlinGraphThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @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 updateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @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 updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1477,13 +2043,106 @@ public Observable> beginDeleteGremlinGraphWithServiceRespo if (graphName == null) { throw new IllegalArgumentException("Parameter graphName 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 = "2020-03-01"; - return service.beginDeleteGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Observable> observable = service.updateGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @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 beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @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 beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable> beginUpdateGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, 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 (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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 = "2020-03-01"; + return service.beginUpdateGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteGremlinGraphDelegate(response); + ServiceResponse clientResponse = beginUpdateGremlinGraphThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1492,18 +2151,18 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteGremlinGraphDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginUpdateGremlinGraphThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. @@ -1512,14 +2171,14 @@ private ServiceResponse beginDeleteGremlinGraphDelegate(Response getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + public ServiceFuture migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateGremlinGraphToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); } /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return migrateGremlinGraphToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> migrateGremlinGraphToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (graphName == null) { + throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + Observable> observable = service.migrateGremlinGraphToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, String graphName) { + return beginMigrateGremlinGraphToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + } + + /** + * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 beginMigrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateGremlinGraphToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + } + + /** + * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { - return getGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable beginMigrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return beginMigrateGremlinGraphToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1551,16 +2291,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> getGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + public Observable> beginMigrateGremlinGraphToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1577,12 +2317,12 @@ public Observable> getGremlin throw new IllegalArgumentException("Parameter graphName is required and cannot be null."); } final String apiVersion = "2020-03-01"; - return service.getGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginMigrateGremlinGraphToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getGremlinGraphThroughputDelegate(response); + ServiceResponse clientResponse = beginMigrateGremlinGraphToAutoscaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1591,59 +2331,57 @@ public Observable> call(Respo }); } - private ServiceResponse getGremlinGraphThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginMigrateGremlinGraphToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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 updateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).toBlocking().last().body(); + public ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, String graphName) { + return migrateGremlinGraphToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().last().body(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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 updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters), serviceCallback); + public ServiceFuture migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateGremlinGraphToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return migrateGremlinGraphToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1652,17 +2390,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Observable> migrateGremlinGraphToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1678,61 +2415,54 @@ public Observable> updateGrem if (graphName == null) { throw new IllegalArgumentException("Parameter graphName 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 = "2020-03-01"; - Observable> observable = service.updateGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.migrateGremlinGraphToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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 beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, String graphName) { + return beginMigrateGremlinGraphToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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 beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters), serviceCallback); + public ServiceFuture beginMigrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateGremlinGraphToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable beginMigrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return beginMigrateGremlinGraphToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1741,17 +2471,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> beginUpdateGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Observable> beginMigrateGremlinGraphToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1767,17 +2496,13 @@ public Observable> beginUpdat if (graphName == null) { throw new IllegalArgumentException("Parameter graphName 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 = "2020-03-01"; - return service.beginUpdateGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginMigrateGremlinGraphToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginUpdateGremlinGraphThroughputDelegate(response); + ServiceResponse clientResponse = beginMigrateGremlinGraphToManualThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1786,7 +2511,7 @@ public Observable> call(Respo }); } - private ServiceResponse beginUpdateGremlinGraphThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginMigrateGremlinGraphToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/MongoDBResourcesImpl.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/MongoDBResourcesImpl.java index bd187b3a7d5aa..41d1f85d557c3 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/MongoDBResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/MongoDBResourcesImpl.java @@ -139,6 +139,30 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + MongoDBResourcesInner client = this.inner(); + return client.migrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + MongoDBResourcesInner client = this.inner(); + return client.migrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + @Override public Observable getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { MongoDBResourcesInner client = this.inner(); @@ -163,6 +187,30 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + MongoDBResourcesInner client = this.inner(); + return client.migrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + MongoDBResourcesInner client = this.inner(); + return client.migrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, collectionName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + @Override public Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { MongoDBResourcesInner client = this.inner(); diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/MongoDBResourcesInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/MongoDBResourcesInner.java index b996e0d8dd964..9d4f6d7e6743e 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/MongoDBResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/MongoDBResourcesInner.java @@ -27,6 +27,7 @@ import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.Response; @@ -95,6 +96,22 @@ interface MongoDBResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default") Observable> 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.v2020_03_01.MongoDBResources migrateMongoDBDatabaseToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateMongoDBDatabaseToAutoscale(@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.v2020_03_01.MongoDBResources beginMigrateMongoDBDatabaseToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateMongoDBDatabaseToAutoscale(@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.v2020_03_01.MongoDBResources migrateMongoDBDatabaseToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateMongoDBDatabaseToManualThroughput(@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.v2020_03_01.MongoDBResources beginMigrateMongoDBDatabaseToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateMongoDBDatabaseToManualThroughput(@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.v2020_03_01.MongoDBResources listMongoDBCollections" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections") Observable> 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); @@ -131,12 +148,28 @@ interface MongoDBResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default") Observable> 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); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2020_03_01.MongoDBResources migrateMongoDBCollectionToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateMongoDBCollectionToAutoscale(@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.v2020_03_01.MongoDBResources beginMigrateMongoDBCollectionToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateMongoDBCollectionToAutoscale(@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.v2020_03_01.MongoDBResources migrateMongoDBCollectionToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateMongoDBCollectionToManualThroughput(@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.v2020_03_01.MongoDBResources beginMigrateMongoDBCollectionToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateMongoDBCollectionToManualThroughput(@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); + } /** * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -150,7 +183,7 @@ public List listMongoDBDatabases(String resource /** * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -163,7 +196,7 @@ public ServiceFuture> listMongoDBDatabasesA /** * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<MongoDBDatabaseGetResultsInner> object @@ -180,7 +213,7 @@ public List call(ServiceResponse> listMongoDBDat /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -240,7 +273,7 @@ public MongoDBDatabaseGetResultsInner getMongoDBDatabase(String resourceGroupNam /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -254,7 +287,7 @@ public ServiceFuture getMongoDBDatabaseAsync(Str /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -272,7 +305,7 @@ public MongoDBDatabaseGetResultsInner call(ServiceResponse getMongoDBDatabaseDelega /** * Create or updates Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. @@ -332,7 +365,7 @@ public MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourc /** * Create or updates Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. @@ -347,7 +380,7 @@ public ServiceFuture createUpdateMongoDBDatabase /** * Create or updates Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. @@ -366,7 +399,7 @@ public MongoDBDatabaseGetResultsInner call(ServiceResponse> createUpdateM /** * Create or updates Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. @@ -414,7 +447,7 @@ public MongoDBDatabaseGetResultsInner beginCreateUpdateMongoDBDatabase(String re /** * Create or updates Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. @@ -429,7 +462,7 @@ public ServiceFuture beginCreateUpdateMongoDBDat /** * Create or updates Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. @@ -448,7 +481,7 @@ public MongoDBDatabaseGetResultsInner call(ServiceResponse beginCreateUpdateMongoDB /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -512,7 +545,7 @@ public void deleteMongoDBDatabase(String resourceGroupName, String accountName, /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -526,7 +559,7 @@ public ServiceFuture deleteMongoDBDatabaseAsync(String resourceGroupName, /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -544,7 +577,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -571,7 +604,7 @@ public Observable> deleteMongoDBDatabaseWithServiceRespons /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -585,7 +618,7 @@ public void beginDeleteMongoDBDatabase(String resourceGroupName, String accountN /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -599,7 +632,7 @@ public ServiceFuture beginDeleteMongoDBDatabaseAsync(String resourceGroupN /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -617,7 +650,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -662,7 +695,7 @@ private ServiceResponse beginDeleteMongoDBDatabaseDelegate(Response getMongoDBDatabaseThroug /** * 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 resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -709,7 +742,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse getMongoDBDatabaseThr /** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -769,7 +802,7 @@ public ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String /** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -784,7 +817,7 @@ public ServiceFuture updateMongoDBDatabaseThr /** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -803,7 +836,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateMong /** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -851,7 +884,7 @@ public ThroughputSettingsGetResultsInner beginUpdateMongoDBDatabaseThroughput(St /** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -866,7 +899,7 @@ public ServiceFuture beginUpdateMongoDBDataba /** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -885,7 +918,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse beginUpdateMongoDBDat } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public List listMongoDBCollections(String resourceGroupName, String accountName, String databaseName) { - return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return migrateMongoDBDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + public ServiceFuture migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateMongoDBDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 + * @return the observable for the request */ - public Observable> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName) { - return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + public Observable migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + return migrateMongoDBDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public List call(ServiceResponse> response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 + * @return the observable for the request */ - public Observable>> listMongoDBCollectionsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + public Observable> migrateMongoDBDatabaseToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1002,93 +1035,67 @@ public Observable>> listM throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } final String apiVersion = "2020-03-01"; - return service.listMongoDBCollections(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listMongoDBCollectionsDelegate(response); - List items = null; - if (result.body() != null) { - items = result.body().items(); - } - ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listMongoDBCollectionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); + Observable> observable = service.migrateMongoDBDatabaseToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public MongoDBCollectionGetResultsInner getMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { - return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateMongoDBDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + public ServiceFuture beginMigrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateMongoDBDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { - return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, MongoDBCollectionGetResultsInner>() { + public Observable beginMigrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateMongoDBDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public MongoDBCollectionGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable> getMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + public Observable> beginMigrateMongoDBDatabaseToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1101,16 +1108,13 @@ public Observable> getMongoDBC 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 = "2020-03-01"; - return service.getMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginMigrateMongoDBDatabaseToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getMongoDBCollectionDelegate(response); + ServiceResponse clientResponse = beginMigrateMongoDBDatabaseToAutoscaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1119,78 +1123,71 @@ public Observable> call(Respon }); } - private ServiceResponse getMongoDBCollectionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginMigrateMongoDBDatabaseToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. + * @return the ThroughputSettingsGetResultsInner 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(); + public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) { + return migrateMongoDBDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters), serviceCallback); + public ServiceFuture migrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateMongoDBDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { - return createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1, MongoDBCollectionGetResultsInner>() { + public Observable migrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return migrateMongoDBDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public MongoDBCollectionGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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> createUpdateMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + public Observable> migrateMongoDBDatabaseToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1203,83 +1200,68 @@ public Observable> createUpdat 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 = "2020-03-01"; - Observable> 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() { }.getType()); + Observable> observable = service.migrateMongoDBDatabaseToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. + * @return the ThroughputSettingsGetResultsInner 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(); + public ThroughputSettingsGetResultsInner beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateMongoDBDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters), serviceCallback); + public ServiceFuture beginMigrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateMongoDBDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { - return beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1, MongoDBCollectionGetResultsInner>() { + public Observable beginMigrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateMongoDBDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public MongoDBCollectionGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable> beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + public Observable> beginMigrateMongoDBDatabaseToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1292,20 +1274,13 @@ public Observable> beginCreate 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 = "2020-03-01"; - return service.beginCreateUpdateMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, createUpdateMongoDBCollectionParameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginMigrateMongoDBDatabaseToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateUpdateMongoDBCollectionDelegate(response); + ServiceResponse clientResponse = beginMigrateMongoDBDatabaseToManualThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1314,74 +1289,71 @@ public Observable> call(Respon }); } - private ServiceResponse beginCreateUpdateMongoDBCollectionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginMigrateMongoDBDatabaseToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 List<MongoDBCollectionGetResultsInner> object if successful. */ - public void deleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { - deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().last().body(); + public List listMongoDBCollections(String resourceGroupName, String accountName, String databaseName) { + return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + public ServiceFuture> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 + * @return the observable to the List<MongoDBCollectionGetResultsInner> object */ - public Observable deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { - return deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, Void>() { + public Observable> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName) { + return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { @Override - public Void call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 + * @return the observable to the List<MongoDBCollectionGetResultsInner> object */ - public Observable> deleteMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + public Observable>> 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."); } @@ -1394,33 +1366,53 @@ public Observable> deleteMongoDBCollectionWithServiceRespo 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 = "2020-03-01"; - Observable> observable = service.deleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return service.listMongoDBCollections(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMongoDBCollectionsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMongoDBCollectionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 void beginDeleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { - beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); + public MongoDBCollectionGetResultsInner getMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. @@ -1428,40 +1420,614 @@ public void beginDeleteMongoDBCollection(String resourceGroupName, String accoun * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + public ServiceFuture getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. + * @return the observable to the MongoDBCollectionGetResultsInner object */ - public Observable beginDeleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { - return beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, Void>() { + public Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, MongoDBCollectionGetResultsInner>() { @Override - public Void call(ServiceResponse response) { + public MongoDBCollectionGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. + * @return the observable to the MongoDBCollectionGetResultsInner object */ - public Observable> beginDeleteMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + public Observable> 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 = "2020-03-01"; + return service.getMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMongoDBCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMongoDBCollectionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1, MongoDBCollectionGetResultsInner>() { + @Override + public MongoDBCollectionGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> 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 = "2020-03-01"; + Observable> 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() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1, MongoDBCollectionGetResultsInner>() { + @Override + public MongoDBCollectionGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> 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 = "2020-03-01"; + return service.beginCreateUpdateMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, createUpdateMongoDBCollectionParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateMongoDBCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateMongoDBCollectionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> 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 = "2020-03-01"; + Observable> observable = service.deleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 beginDeleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 beginDeleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> 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 = "2020-03-01"; + return service.beginDeleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteMongoDBCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteMongoDBCollectionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> 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 = "2020-03-01"; + return service.getMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMongoDBCollectionThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMongoDBCollectionThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters), serviceCallback); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> 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."); } @@ -1477,13 +2043,106 @@ public Observable> beginDeleteMongoDBCollectionWithService 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 = "2020-03-01"; - return service.beginDeleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Observable> 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() { }.getType()); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters), serviceCallback); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> 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 = "2020-03-01"; + return service.beginUpdateMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteMongoDBCollectionDelegate(response); + ServiceResponse clientResponse = beginUpdateMongoDBCollectionThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1492,18 +2151,18 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteMongoDBCollectionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginUpdateMongoDBCollectionThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.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. + * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. @@ -1512,14 +2171,14 @@ private ServiceResponse beginDeleteMongoDBCollectionDelegate(Response getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + public ServiceFuture migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateMongoDBCollectionToAutoscaleWithServiceResponseAsync(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. + * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return migrateMongoDBCollectionToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> migrateMongoDBCollectionToAutoscaleWithServiceResponseAsync(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 = "2020-03-01"; + Observable> observable = service.migrateMongoDBCollectionToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return beginMigrateMongoDBCollectionToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); + } + + /** + * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 beginMigrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateMongoDBCollectionToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + } + + /** + * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { - return getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable beginMigrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return beginMigrateMongoDBCollectionToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1551,16 +2291,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> getMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + public Observable> beginMigrateMongoDBCollectionToAutoscaleWithServiceResponseAsync(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."); } @@ -1577,12 +2317,12 @@ public Observable> getMongoDB throw new IllegalArgumentException("Parameter collectionName is required and cannot be null."); } final String apiVersion = "2020-03-01"; - return service.getMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginMigrateMongoDBCollectionToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getMongoDBCollectionThroughputDelegate(response); + ServiceResponse clientResponse = beginMigrateMongoDBCollectionToAutoscaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1591,59 +2331,57 @@ public Observable> call(Respo }); } - private ServiceResponse getMongoDBCollectionThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginMigrateMongoDBCollectionToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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(); + public ThroughputSettingsGetResultsInner migrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return migrateMongoDBCollectionToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().last().body(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters), serviceCallback); + public ServiceFuture migrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateMongoDBCollectionToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable migrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return migrateMongoDBCollectionToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1652,17 +2390,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Observable> migrateMongoDBCollectionToManualThroughputWithServiceResponseAsync(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."); } @@ -1678,61 +2415,54 @@ public Observable> updateMong 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 = "2020-03-01"; - Observable> 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() { }.getType()); + Observable> observable = service.migrateMongoDBCollectionToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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(); + public ThroughputSettingsGetResultsInner beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return beginMigrateMongoDBCollectionToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters), serviceCallback); + public ServiceFuture beginMigrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateMongoDBCollectionToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable beginMigrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return beginMigrateMongoDBCollectionToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1741,17 +2471,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Observable> beginMigrateMongoDBCollectionToManualThroughputWithServiceResponseAsync(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."); } @@ -1767,17 +2496,13 @@ public Observable> beginUpdat 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 = "2020-03-01"; - return service.beginUpdateMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginMigrateMongoDBCollectionToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginUpdateMongoDBCollectionThroughputDelegate(response); + ServiceResponse clientResponse = beginMigrateMongoDBCollectionToManualThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1786,7 +2511,7 @@ public Observable> call(Respo }); } - private ServiceResponse beginUpdateMongoDBCollectionThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginMigrateMongoDBCollectionToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/NotebookWorkspaceImpl.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/NotebookWorkspaceImpl.java index 71ad5a76e9979..b9f5dd887b86c 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/NotebookWorkspaceImpl.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/NotebookWorkspaceImpl.java @@ -10,7 +10,6 @@ import com.microsoft.azure.management.cosmosdb.v2020_03_01.NotebookWorkspace; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import com.microsoft.azure.management.cosmosdb.v2020_03_01.NotebookWorkspaceCreateUpdateParameters; import rx.Observable; class NotebookWorkspaceImpl extends CreatableUpdatableImpl implements NotebookWorkspace, NotebookWorkspace.Definition, NotebookWorkspace.Update { @@ -45,14 +44,14 @@ public CosmosDBManager manager() { @Override public Observable createResourceAsync() { NotebookWorkspacesInner client = this.manager().inner().notebookWorkspaces(); - return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, new NotebookWorkspaceCreateUpdateParameters()) + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { NotebookWorkspacesInner client = this.manager().inner().notebookWorkspaces(); - return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, new NotebookWorkspaceCreateUpdateParameters()) + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName) .map(innerToFluentMap(this)); } diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/NotebookWorkspacesInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/NotebookWorkspacesInner.java index ec68f8952a065..1b623f1a2bdb7 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/NotebookWorkspacesInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/NotebookWorkspacesInner.java @@ -107,7 +107,7 @@ interface NotebookWorkspacesService { /** * Gets the notebook workspace resources of an existing Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -121,7 +121,7 @@ public List listByDatabaseAccount(String resourceGroupNa /** * Gets the notebook workspace resources of an existing Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -134,7 +134,7 @@ public ServiceFuture> listByDatabaseAccountAsync(St /** * Gets the notebook workspace resources of an existing Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<NotebookWorkspaceInner> object @@ -151,7 +151,7 @@ public List call(ServiceResponse>> listByDatabaseA if (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; return service.listByDatabaseAccount(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -196,7 +196,7 @@ private ServiceResponse> listByDatabaseAccountD /** * Gets the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -210,7 +210,7 @@ public NotebookWorkspaceInner get(String resourceGroupName, String accountName) /** * Gets the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -223,7 +223,7 @@ public ServiceFuture getAsync(String resourceGroupName, /** * Gets the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the NotebookWorkspaceInner object @@ -240,7 +240,7 @@ public NotebookWorkspaceInner call(ServiceResponse respo /** * Gets the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the NotebookWorkspaceInner object @@ -256,7 +256,7 @@ public Observable> getWithServiceRespons throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; return service.get(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -281,40 +281,40 @@ private ServiceResponse getDelegate(Response createOrUpdateAsync(String resourceGroupName, String accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, notebookCreateUpdateParameters), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); } /** * Creates the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createOrUpdateAsync(String resourceGroupName, String accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, notebookCreateUpdateParameters).map(new Func1, NotebookWorkspaceInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String accountName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, NotebookWorkspaceInner>() { @Override public NotebookWorkspaceInner call(ServiceResponse response) { return response.body(); @@ -325,12 +325,12 @@ public NotebookWorkspaceInner call(ServiceResponse respo /** * Creates the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -341,7 +341,7 @@ public Observable> createOrUpdateWithSer throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), notebookCreateUpdateParameters, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -349,40 +349,40 @@ public Observable> createOrUpdateWithSer /** * Creates the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the NotebookWorkspaceInner object if successful. */ - public NotebookWorkspaceInner beginCreateOrUpdate(String resourceGroupName, String accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, notebookCreateUpdateParameters).toBlocking().single().body(); + public NotebookWorkspaceInner beginCreateOrUpdate(String resourceGroupName, String accountName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); } /** * Creates the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 beginCreateOrUpdateAsync(String resourceGroupName, String accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, notebookCreateUpdateParameters), serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); } /** * Creates the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the NotebookWorkspaceInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, notebookCreateUpdateParameters).map(new Func1, NotebookWorkspaceInner>() { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, NotebookWorkspaceInner>() { @Override public NotebookWorkspaceInner call(ServiceResponse response) { return response.body(); @@ -393,12 +393,12 @@ public NotebookWorkspaceInner call(ServiceResponse respo /** * Creates the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the NotebookWorkspaceInner object */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -409,7 +409,7 @@ public Observable> beginCreateOrUpdateWi throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), notebookCreateUpdateParameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -434,7 +434,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Resp /** * Deletes the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -447,7 +447,7 @@ public void delete(String resourceGroupName, String accountName) { /** * Deletes the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -460,7 +460,7 @@ public ServiceFuture deleteAsync(String resourceGroupName, String accountN /** * Deletes the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -477,7 +477,7 @@ public Void call(ServiceResponse response) { /** * Deletes the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -493,7 +493,7 @@ public Observable> deleteWithServiceResponseAsync(String r throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -501,7 +501,7 @@ public Observable> deleteWithServiceResponseAsync(String r /** * Deletes the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -514,7 +514,7 @@ public void beginDelete(String resourceGroupName, String accountName) { /** * Deletes the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -527,7 +527,7 @@ public ServiceFuture beginDeleteAsync(String resourceGroupName, String acc /** * Deletes the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -544,7 +544,7 @@ public Void call(ServiceResponse response) { /** * Deletes the notebook workspace for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -560,7 +560,7 @@ public Observable> beginDeleteWithServiceResponseAsync(Str throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -586,7 +586,7 @@ private ServiceResponse beginDeleteDelegate(Response respons /** * Retrieves the connection info for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -600,7 +600,7 @@ public NotebookWorkspaceConnectionInfoResultInner listConnectionInfo(String reso /** * Retrieves the connection info for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -613,7 +613,7 @@ public ServiceFuture listConnectionI /** * Retrieves the connection info for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the NotebookWorkspaceConnectionInfoResultInner object @@ -630,7 +630,7 @@ public NotebookWorkspaceConnectionInfoResultInner call(ServiceResponse> l throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; return service.listConnectionInfo(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -671,7 +671,7 @@ private ServiceResponse listConnecti /** * Regenerates the auth token for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -684,7 +684,7 @@ public void regenerateAuthToken(String resourceGroupName, String accountName) { /** * Regenerates the auth token for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -697,7 +697,7 @@ public ServiceFuture regenerateAuthTokenAsync(String resourceGroupName, St /** * Regenerates the auth token for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -714,7 +714,7 @@ public Void call(ServiceResponse response) { /** * Regenerates the auth token for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -730,7 +730,7 @@ public Observable> regenerateAuthTokenWithServiceResponseA throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; Observable> observable = service.regenerateAuthToken(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -738,7 +738,7 @@ public Observable> regenerateAuthTokenWithServiceResponseA /** * Regenerates the auth token for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -751,7 +751,7 @@ public void beginRegenerateAuthToken(String resourceGroupName, String accountNam /** * Regenerates the auth token for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -764,7 +764,7 @@ public ServiceFuture beginRegenerateAuthTokenAsync(String resourceGroupNam /** * Regenerates the auth token for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -781,7 +781,7 @@ public Void call(ServiceResponse response) { /** * Regenerates the auth token for the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -797,7 +797,7 @@ public Observable> beginRegenerateAuthTokenWithServiceResp throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; return service.beginRegenerateAuthToken(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -823,7 +823,7 @@ private ServiceResponse beginRegenerateAuthTokenDelegate(Response startAsync(String resourceGroupName, String accountNa /** * Starts the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -866,7 +866,7 @@ public Void call(ServiceResponse response) { /** * Starts the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -882,7 +882,7 @@ public Observable> startWithServiceResponseAsync(String re throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -890,7 +890,7 @@ public Observable> startWithServiceResponseAsync(String re /** * Starts the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server @@ -903,7 +903,7 @@ public void beginStart(String resourceGroupName, String accountName) { /** * Starts the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -916,7 +916,7 @@ public ServiceFuture beginStartAsync(String resourceGroupName, String acco /** * Starts the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -933,7 +933,7 @@ public Void call(ServiceResponse response) { /** * Starts the notebook workspace. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -949,7 +949,7 @@ public Observable> beginStartWithServiceResponseAsync(Stri throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } final String notebookWorkspaceName = "default"; - final String apiVersion = "2019-08-01"; + final String apiVersion = "2020-03-01"; return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PartitionKeyRangeIdRegionsInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PartitionKeyRangeIdRegionsInner.java index fb2af39fccac3..dd4fe69327403 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PartitionKeyRangeIdRegionsInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PartitionKeyRangeIdRegionsInner.java @@ -61,7 +61,7 @@ interface PartitionKeyRangeIdRegionsService { /** * Retrieves the metrics determined by the given filter for the given partition key range id and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -80,7 +80,7 @@ public List listMetrics(String resourceGroupName, String a /** * Retrieves the metrics determined by the given filter for the given partition key range id and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -98,7 +98,7 @@ public ServiceFuture> listMetricsAsync(String resourc /** * Retrieves the metrics determined by the given filter for the given partition key range id and region. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param region Cosmos DB region, with spaces between words and each word capitalized. * @param databaseRid Cosmos DB database rid. @@ -120,7 +120,7 @@ public List call(ServiceResponse listMetrics(String resourceGroupName, String a /** * Retrieves the metrics determined by the given filter for the given partition key range id. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -96,7 +96,7 @@ public ServiceFuture> listMetricsAsync(String resourc /** * Retrieves the metrics determined by the given filter for the given partition key range id. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. * @param collectionRid Cosmos DB collection rid. @@ -117,7 +117,7 @@ public List call(ServiceResponse listMetrics(String resourceGroupName, String /** * Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -94,7 +94,7 @@ public ServiceFuture> listMetricsAsync(String resour /** * Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -114,7 +114,7 @@ public List call(ServiceResponse listMetrics(String resourceGroupName, String /** * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -92,7 +92,7 @@ public ServiceFuture> listMetricsAsync(String resour /** * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -111,7 +111,7 @@ public List call(ServiceResponse listMetrics(String resourceGroupName, String /** * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -90,7 +90,7 @@ public ServiceFuture> listMetricsAsync(String resour /** * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -108,7 +108,7 @@ public List call(ServiceResponse requiredMembers() { return this.inner().requiredMembers(); } + @Override + public List requiredZoneNames() { + return this.inner().requiredZoneNames(); + } + @Override public String type() { return this.inner().type(); diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PrivateLinkResourceInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PrivateLinkResourceInner.java index 8ff52c836b395..c22a64de0ba49 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PrivateLinkResourceInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PrivateLinkResourceInner.java @@ -30,6 +30,12 @@ public class PrivateLinkResourceInner extends ARMProxyResource { @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; + /** + * The private link resource required zone names. + */ + @JsonProperty(value = "properties.requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + /** * Get the private link resource group id. * @@ -48,4 +54,13 @@ public List requiredMembers() { return this.requiredMembers; } + /** + * Get the private link resource required zone names. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + } diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PrivateLinkResourcesInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PrivateLinkResourcesInner.java index a9e77bec0f41b..1cc5127c77b65 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PrivateLinkResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/PrivateLinkResourcesInner.java @@ -65,7 +65,7 @@ interface PrivateLinkResourcesService { /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -79,7 +79,7 @@ public List listByDatabaseAccount(String resourceGroup /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -92,7 +92,7 @@ public ServiceFuture> listByDatabaseAccountAsync( /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<PrivateLinkResourceInner> object @@ -109,7 +109,7 @@ public List call(ServiceResponse> listByDatabaseAccoun /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -169,7 +169,7 @@ public PrivateLinkResourceInner get(String resourceGroupName, String accountName /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -183,7 +183,7 @@ public ServiceFuture getAsync(String resourceGroupName /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -201,7 +201,7 @@ public PrivateLinkResourceInner call(ServiceResponse r /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/SqlResourcesImpl.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/SqlResourcesImpl.java index 374fbe8f4ce1d..064cf27c1930c 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/SqlResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/SqlResourcesImpl.java @@ -211,6 +211,30 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + SqlResourcesInner client = this.inner(); + return client.migrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + SqlResourcesInner client = this.inner(); + return client.migrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + @Override public Observable getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { SqlResourcesInner client = this.inner(); @@ -235,6 +259,30 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable migrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + SqlResourcesInner client = this.inner(); + return client.migrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + SqlResourcesInner client = this.inner(); + return client.migrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + @Override public Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { SqlResourcesInner client = this.inner(); diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/SqlResourcesInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/SqlResourcesInner.java index e3a888dd1caa9..ff8f52250a413 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/SqlResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/SqlResourcesInner.java @@ -30,6 +30,7 @@ import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.Response; @@ -98,6 +99,22 @@ interface SqlResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default") Observable> beginUpdateSqlDatabaseThroughput(@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.v2020_03_01.SqlResources migrateSqlDatabaseToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateSqlDatabaseToAutoscale(@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.v2020_03_01.SqlResources beginMigrateSqlDatabaseToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateSqlDatabaseToAutoscale(@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.v2020_03_01.SqlResources migrateSqlDatabaseToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateSqlDatabaseToManualThroughput(@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.v2020_03_01.SqlResources beginMigrateSqlDatabaseToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateSqlDatabaseToManualThroughput(@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.v2020_03_01.SqlResources listSqlContainers" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers") Observable> listSqlContainers(@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); @@ -134,6 +151,22 @@ interface SqlResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default") Observable> beginUpdateSqlContainerThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.v2020_03_01.SqlResources migrateSqlContainerToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateSqlContainerToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.v2020_03_01.SqlResources beginMigrateSqlContainerToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateSqlContainerToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.v2020_03_01.SqlResources migrateSqlContainerToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateSqlContainerToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.v2020_03_01.SqlResources beginMigrateSqlContainerToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateSqlContainerToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.v2020_03_01.SqlResources listSqlStoredProcedures" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures") Observable> listSqlStoredProcedures(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -211,7 +244,7 @@ interface SqlResourcesService { /** * Lists the SQL databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -225,7 +258,7 @@ public List listSqlDatabases(String resourceGroupNam /** * Lists the SQL databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -238,7 +271,7 @@ public ServiceFuture> listSqlDatabasesAsync(Str /** * Lists the SQL databases under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<SqlDatabaseGetResultsInner> object @@ -255,7 +288,7 @@ public List call(ServiceResponse> listSqlDatabasesDe /** * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -315,7 +348,7 @@ public SqlDatabaseGetResultsInner getSqlDatabase(String resourceGroupName, Strin /** * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -329,7 +362,7 @@ public ServiceFuture getSqlDatabaseAsync(String reso /** * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -347,7 +380,7 @@ public SqlDatabaseGetResultsInner call(ServiceResponse getSqlDatabaseDelegate(Respo /** * Create or update an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. @@ -407,7 +440,7 @@ public SqlDatabaseGetResultsInner createUpdateSqlDatabase(String resourceGroupNa /** * Create or update an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. @@ -422,7 +455,7 @@ public ServiceFuture createUpdateSqlDatabaseAsync(St /** * Create or update an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. @@ -441,7 +474,7 @@ public SqlDatabaseGetResultsInner call(ServiceResponse> createUpdateSqlDa /** * Create or update an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. @@ -489,7 +522,7 @@ public SqlDatabaseGetResultsInner beginCreateUpdateSqlDatabase(String resourceGr /** * Create or update an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. @@ -504,7 +537,7 @@ public ServiceFuture beginCreateUpdateSqlDatabaseAsy /** * Create or update an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. @@ -523,7 +556,7 @@ public SqlDatabaseGetResultsInner call(ServiceResponse beginCreateUpdateSqlDatabase /** * Deletes an existing Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -587,7 +620,7 @@ public void deleteSqlDatabase(String resourceGroupName, String accountName, Stri /** * Deletes an existing Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -601,7 +634,7 @@ public ServiceFuture deleteSqlDatabaseAsync(String resourceGroupName, Stri /** * Deletes an existing Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -619,7 +652,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -646,7 +679,7 @@ public Observable> deleteSqlDatabaseWithServiceResponseAsy /** * Deletes an existing Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -660,7 +693,7 @@ public void beginDeleteSqlDatabase(String resourceGroupName, String accountName, /** * Deletes an existing Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -674,7 +707,7 @@ public ServiceFuture beginDeleteSqlDatabaseAsync(String resourceGroupName, /** * Deletes an existing Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -692,7 +725,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -737,7 +770,7 @@ private ServiceResponse beginDeleteSqlDatabaseDelegate(Response getSqlDatabaseThroughput /** * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -784,7 +817,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse getSqlDatabaseThrough /** * Update RUs per second of an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database. @@ -844,7 +877,7 @@ public ThroughputSettingsGetResultsInner updateSqlDatabaseThroughput(String reso /** * Update RUs per second of an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database. @@ -859,7 +892,7 @@ public ServiceFuture updateSqlDatabaseThrough /** * Update RUs per second of an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database. @@ -878,7 +911,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateSqlD /** * Update RUs per second of an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database. @@ -926,7 +959,7 @@ public ThroughputSettingsGetResultsInner beginUpdateSqlDatabaseThroughput(String /** * Update RUs per second of an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database. @@ -941,7 +974,7 @@ public ServiceFuture beginUpdateSqlDatabaseTh /** * Update RUs per second of an Azure Cosmos DB SQL database. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL database. @@ -960,7 +993,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse beginUpdateSqlDatabas } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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<SqlContainerGetResultsInner> object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public List listSqlContainers(String resourceGroupName, String accountName, String databaseName) { - return listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner migrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return migrateSqlDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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> listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + public ServiceFuture migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateSqlDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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<SqlContainerGetResultsInner> object + * @return the observable for the request */ - public Observable> listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName) { - return listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + public Observable migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + return migrateSqlDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public List call(ServiceResponse> response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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<SqlContainerGetResultsInner> object + * @return the observable for the request */ - public Observable>> listSqlContainersWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + public Observable> migrateSqlDatabaseToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1077,93 +1110,67 @@ public Observable>> listSqlCon throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } final String apiVersion = "2020-03-01"; - return service.listSqlContainers(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listSqlContainersDelegate(response); - List items = null; - if (result.body() != null) { - items = result.body().items(); - } - ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listSqlContainersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); + Observable> observable = service.migrateSqlDatabaseToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container 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 SqlContainerGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public SqlContainerGetResultsInner getSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { - return getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateSqlDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container 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 getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + public ServiceFuture beginMigrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateSqlDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SqlContainerGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { - return getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, SqlContainerGetResultsInner>() { + public Observable beginMigrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateSqlDatabaseToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public SqlContainerGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SqlContainerGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable> getSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + public Observable> beginMigrateSqlDatabaseToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1176,16 +1183,13 @@ public Observable> getSqlContainerW if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (containerName == null) { - throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); - } final String apiVersion = "2020-03-01"; - return service.getSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginMigrateSqlDatabaseToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getSqlContainerDelegate(response); + ServiceResponse clientResponse = beginMigrateSqlDatabaseToAutoscaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1194,78 +1198,71 @@ public Observable> call(Response getSqlContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginMigrateSqlDatabaseToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Create or update an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. * @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 SqlContainerGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public SqlContainerGetResultsInner createUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { - return createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).toBlocking().last().body(); + public ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) { + return migrateSqlDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); } /** - * Create or update an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. * @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 createUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters), serviceCallback); + public ServiceFuture migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateSqlDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Create or update an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { - return createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).map(new Func1, SqlContainerGetResultsInner>() { + public Observable migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return migrateSqlDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public SqlContainerGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createUpdateSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + public Observable> migrateSqlDatabaseToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1278,83 +1275,68 @@ public Observable> createUpdateSqlC if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (containerName == null) { - throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); - } - if (createUpdateSqlContainerParameters == null) { - throw new IllegalArgumentException("Parameter createUpdateSqlContainerParameters is required and cannot be null."); - } - Validator.validate(createUpdateSqlContainerParameters); final String apiVersion = "2020-03-01"; - Observable> observable = service.createUpdateSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, createUpdateSqlContainerParameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.migrateSqlDatabaseToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Create or update an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. * @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 SqlContainerGetResultsInner object if successful. + * @return the ThroughputSettingsGetResultsInner object if successful. */ - public SqlContainerGetResultsInner beginCreateUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { - return beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateSqlDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Create or update an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. * @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 beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters), serviceCallback); + public ServiceFuture beginMigrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateSqlDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Create or update an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SqlContainerGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { - return beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).map(new Func1, SqlContainerGetResultsInner>() { + public Observable beginMigrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return beginMigrateSqlDatabaseToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override - public SqlContainerGetResultsInner call(ServiceResponse response) { + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Create or update an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SqlContainerGetResultsInner object + * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable> beginCreateUpdateSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + public Observable> beginMigrateSqlDatabaseToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1367,20 +1349,13 @@ public Observable> beginCreateUpdat if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (containerName == null) { - throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); - } - if (createUpdateSqlContainerParameters == null) { - throw new IllegalArgumentException("Parameter createUpdateSqlContainerParameters is required and cannot be null."); - } - Validator.validate(createUpdateSqlContainerParameters); final String apiVersion = "2020-03-01"; - return service.beginCreateUpdateSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, createUpdateSqlContainerParameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginMigrateSqlDatabaseToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateUpdateSqlContainerDelegate(response); + ServiceResponse clientResponse = beginMigrateSqlDatabaseToManualThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1389,74 +1364,71 @@ public Observable> call(Response beginCreateUpdateSqlContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginMigrateSqlDatabaseToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Lists the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container 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<SqlContainerGetResultsInner> object if successful. */ - public void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { - deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().last().body(); + public List listSqlContainers(String resourceGroupName, String accountName, String databaseName) { + return listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Lists the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container 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 deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + public ServiceFuture> listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Lists the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<SqlContainerGetResultsInner> object */ - public Observable deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { - return deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, Void>() { + public Observable> listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName) { + return listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { @Override - public Void call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Lists the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<SqlContainerGetResultsInner> object */ - public Observable> deleteSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + public Observable>> listSqlContainersWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1469,33 +1441,53 @@ public Observable> deleteSqlContainerWithServiceResponseAs if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (containerName == null) { - throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); - } final String apiVersion = "2020-03-01"; - Observable> observable = service.deleteSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return service.listSqlContainers(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSqlContainersDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSqlContainersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Gets the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container 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 SqlContainerGetResultsInner object if successful. */ - public void beginDeleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { - beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + public SqlContainerGetResultsInner getSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Gets the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -1503,40 +1495,614 @@ public void beginDeleteSqlContainer(String resourceGroupName, String accountName * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + public ServiceFuture getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Gets the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SqlContainerGetResultsInner object */ - public Observable beginDeleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { - return beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, Void>() { + public Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, SqlContainerGetResultsInner>() { @Override - public Void call(ServiceResponse response) { + public SqlContainerGetResultsInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Gets the SQL container under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SqlContainerGetResultsInner object */ - public Observable> beginDeleteSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + public Observable> getSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.getSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlContainerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @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 SqlContainerGetResultsInner object if successful. + */ + public SqlContainerGetResultsInner createUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @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 createUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).map(new Func1, SqlContainerGetResultsInner>() { + @Override + public SqlContainerGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (createUpdateSqlContainerParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlContainerParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlContainerParameters); + final String apiVersion = "2020-03-01"; + Observable> observable = service.createUpdateSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, createUpdateSqlContainerParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @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 SqlContainerGetResultsInner object if successful. + */ + public SqlContainerGetResultsInner beginCreateUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @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 beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlContainerGetResultsInner object + */ + public Observable beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).map(new Func1, SqlContainerGetResultsInner>() { + @Override + public SqlContainerGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlContainerGetResultsInner object + */ + public Observable> beginCreateUpdateSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (createUpdateSqlContainerParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlContainerParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlContainerParameters); + final String apiVersion = "2020-03-01"; + return service.beginCreateUpdateSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, createUpdateSqlContainerParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateSqlContainerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateSqlContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { + deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + Observable> observable = service.deleteSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 beginDeleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { + beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 beginDeleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.beginDeleteSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteSqlContainerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteSqlContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 getSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable> getSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.getSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlContainerThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlContainerThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @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 updateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @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 updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1552,13 +2118,106 @@ public Observable> beginDeleteSqlContainerWithServiceRespo if (containerName == null) { throw new IllegalArgumentException("Parameter containerName 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 = "2020-03-01"; - return service.beginDeleteSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Observable> observable = service.updateSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @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 beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @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 beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable> beginUpdateSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 = "2020-03-01"; + return service.beginUpdateSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteSqlContainerDelegate(response); + ServiceResponse clientResponse = beginUpdateSqlContainerThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1567,18 +2226,18 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteSqlContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginUpdateSqlContainerThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -1587,14 +2246,14 @@ private ServiceResponse beginDeleteSqlContainerDelegate(Response getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + public ServiceFuture migrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateSqlContainerToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); } /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable migrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return migrateSqlContainerToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> migrateSqlContainerToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + Observable> observable = service.migrateSqlContainerToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, String containerName) { + return beginMigrateSqlContainerToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateSqlContainerToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { - return getSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return beginMigrateSqlContainerToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1626,16 +2366,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> getSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + public Observable> beginMigrateSqlContainerToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1652,12 +2392,12 @@ public Observable> getSqlCont throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); } final String apiVersion = "2020-03-01"; - return service.getSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginMigrateSqlContainerToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getSqlContainerThroughputDelegate(response); + ServiceResponse clientResponse = beginMigrateSqlContainerToAutoscaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1666,59 +2406,57 @@ public Observable> call(Respo }); } - private ServiceResponse getSqlContainerThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginMigrateSqlContainerToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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 updateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).toBlocking().last().body(); + public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, String containerName) { + return migrateSqlContainerToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().last().body(); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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 updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters), serviceCallback); + public ServiceFuture migrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateSqlContainerToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable migrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return migrateSqlContainerToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1727,17 +2465,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Observable> migrateSqlContainerToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1753,61 +2490,54 @@ public Observable> updateSqlC if (containerName == null) { throw new IllegalArgumentException("Parameter containerName 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 = "2020-03-01"; - Observable> observable = service.updateSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.migrateSqlContainerToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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 beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).toBlocking().single().body(); + public ThroughputSettingsGetResultsInner beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, String containerName) { + return beginMigrateSqlContainerToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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 beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters), serviceCallback); + public ServiceFuture beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateSqlContainerToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ThroughputSettingsGetResultsInner object */ - public Observable beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).map(new Func1, ThroughputSettingsGetResultsInner>() { + public Observable beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return beginMigrateSqlContainerToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, ThroughputSettingsGetResultsInner>() { @Override public ThroughputSettingsGetResultsInner call(ServiceResponse response) { return response.body(); @@ -1816,17 +2546,16 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> beginUpdateSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Observable> beginMigrateSqlContainerToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1842,17 +2571,13 @@ public Observable> beginUpdat if (containerName == null) { throw new IllegalArgumentException("Parameter containerName 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 = "2020-03-01"; - return service.beginUpdateSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, updateThroughputParameters, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginMigrateSqlContainerToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginUpdateSqlContainerThroughputDelegate(response); + ServiceResponse clientResponse = beginMigrateSqlContainerToManualThroughputDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1861,7 +2586,7 @@ public Observable> call(Respo }); } - private ServiceResponse beginUpdateSqlContainerThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginMigrateSqlContainerToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) @@ -1872,7 +2597,7 @@ private ServiceResponse beginUpdateSqlContain /** * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -1888,7 +2613,7 @@ public List listSqlStoredProcedures(String re /** * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -1903,7 +2628,7 @@ public ServiceFuture> listSqlStoredProce /** * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -1922,7 +2647,7 @@ public List call(ServiceResponse> listSqlStor /** * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -1992,7 +2717,7 @@ public SqlStoredProcedureGetResultsInner getSqlStoredProcedure(String resourceGr /** * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2008,7 +2733,7 @@ public ServiceFuture getSqlStoredProcedureAsy /** * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2028,7 +2753,7 @@ public SqlStoredProcedureGetResultsInner call(ServiceResponse getSqlStoredProcedure /** * Create or update an Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2098,7 +2823,7 @@ public SqlStoredProcedureGetResultsInner createUpdateSqlStoredProcedure(String r /** * Create or update an Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2115,7 +2840,7 @@ public ServiceFuture createUpdateSqlStoredPro /** * Create or update an Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2136,7 +2861,7 @@ public SqlStoredProcedureGetResultsInner call(ServiceResponse> createUpda /** * Create or update an Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2194,7 +2919,7 @@ public SqlStoredProcedureGetResultsInner beginCreateUpdateSqlStoredProcedure(Str /** * Create or update an Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2211,7 +2936,7 @@ public ServiceFuture beginCreateUpdateSqlStor /** * Create or update an Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2232,7 +2957,7 @@ public SqlStoredProcedureGetResultsInner call(ServiceResponse beginCreateUpdateSqlS /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2306,7 +3031,7 @@ public void deleteSqlStoredProcedure(String resourceGroupName, String accountNam /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2322,7 +3047,7 @@ public ServiceFuture deleteSqlStoredProcedureAsync(String resourceGroupNam /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2342,7 +3067,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2377,7 +3102,7 @@ public Observable> deleteSqlStoredProcedureWithServiceResp /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2393,7 +3118,7 @@ public void beginDeleteSqlStoredProcedure(String resourceGroupName, String accou /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2409,7 +3134,7 @@ public ServiceFuture beginDeleteSqlStoredProcedureAsync(String resourceGro /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2429,7 +3154,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB SQL storedProcedure. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2482,7 +3207,7 @@ private ServiceResponse beginDeleteSqlStoredProcedureDelegate(Response listSqlUserDefinedFunctions(S /** * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2513,7 +3238,7 @@ public ServiceFuture> listSqlUserDef /** * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2532,7 +3257,7 @@ public List call(ServiceResponse> listSql /** * Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2602,7 +3327,7 @@ public SqlUserDefinedFunctionGetResultsInner getSqlUserDefinedFunction(String re /** * Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2618,7 +3343,7 @@ public ServiceFuture getSqlUserDefinedFun /** * Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2638,7 +3363,7 @@ public SqlUserDefinedFunctionGetResultsInner call(ServiceResponse getSqlUserDefined /** * Create or update an Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2708,7 +3433,7 @@ public SqlUserDefinedFunctionGetResultsInner createUpdateSqlUserDefinedFunction( /** * Create or update an Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2725,7 +3450,7 @@ public ServiceFuture createUpdateSqlUserD /** * Create or update an Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2746,7 +3471,7 @@ public SqlUserDefinedFunctionGetResultsInner call(ServiceResponse> create /** * Create or update an Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2804,7 +3529,7 @@ public SqlUserDefinedFunctionGetResultsInner beginCreateUpdateSqlUserDefinedFunc /** * Create or update an Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2821,7 +3546,7 @@ public ServiceFuture beginCreateUpdateSql /** * Create or update an Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2842,7 +3567,7 @@ public SqlUserDefinedFunctionGetResultsInner call(ServiceResponse beginCreateUpdate /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2916,7 +3641,7 @@ public void deleteSqlUserDefinedFunction(String resourceGroupName, String accoun /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2932,7 +3657,7 @@ public ServiceFuture deleteSqlUserDefinedFunctionAsync(String resourceGrou /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2952,7 +3677,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -2987,7 +3712,7 @@ public Observable> deleteSqlUserDefinedFunctionWithService /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3003,7 +3728,7 @@ public void beginDeleteSqlUserDefinedFunction(String resourceGroupName, String a /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3019,7 +3744,7 @@ public ServiceFuture beginDeleteSqlUserDefinedFunctionAsync(String resourc /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3039,7 +3764,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3092,7 +3817,7 @@ private ServiceResponse beginDeleteSqlUserDefinedFunctionDelegate(Response /** * Lists the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3108,7 +3833,7 @@ public List listSqlTriggers(String resourceGroupName, /** * Lists the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3123,7 +3848,7 @@ public ServiceFuture> listSqlTriggersAsync(Strin /** * Lists the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3142,7 +3867,7 @@ public List call(ServiceResponse> listSqlTriggersDele /** * Gets the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3212,7 +3937,7 @@ public SqlTriggerGetResultsInner getSqlTrigger(String resourceGroupName, String /** * Gets the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3228,7 +3953,7 @@ public ServiceFuture getSqlTriggerAsync(String resour /** * Gets the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3248,7 +3973,7 @@ public SqlTriggerGetResultsInner call(ServiceResponse /** * Gets the SQL trigger under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3300,7 +4025,7 @@ private ServiceResponse getSqlTriggerDelegate(Respons /** * Create or update an Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3318,7 +4043,7 @@ public SqlTriggerGetResultsInner createUpdateSqlTrigger(String resourceGroupName /** * Create or update an Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3335,7 +4060,7 @@ public ServiceFuture createUpdateSqlTriggerAsync(Stri /** * Create or update an Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3356,7 +4081,7 @@ public SqlTriggerGetResultsInner call(ServiceResponse /** * Create or update an Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3396,7 +4121,7 @@ public Observable> createUpdateSqlTri /** * Create or update an Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3414,7 +4139,7 @@ public SqlTriggerGetResultsInner beginCreateUpdateSqlTrigger(String resourceGrou /** * Create or update an Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3431,7 +4156,7 @@ public ServiceFuture beginCreateUpdateSqlTriggerAsync /** * Create or update an Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3452,7 +4177,7 @@ public SqlTriggerGetResultsInner call(ServiceResponse /** * Create or update an Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3510,7 +4235,7 @@ private ServiceResponse beginCreateUpdateSqlTriggerDe /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3526,7 +4251,7 @@ public void deleteSqlTrigger(String resourceGroupName, String accountName, Strin /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3542,7 +4267,7 @@ public ServiceFuture deleteSqlTriggerAsync(String resourceGroupName, Strin /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3562,7 +4287,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3597,7 +4322,7 @@ public Observable> deleteSqlTriggerWithServiceResponseAsyn /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3613,7 +4338,7 @@ public void beginDeleteSqlTrigger(String resourceGroupName, String accountName, /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3629,7 +4354,7 @@ public ServiceFuture beginDeleteSqlTriggerAsync(String resourceGroupName, /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. @@ -3649,7 +4374,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB SQL trigger. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/TableResourcesImpl.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/TableResourcesImpl.java index bcbd688fb429e..401979bc731ac 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/TableResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/TableResourcesImpl.java @@ -116,4 +116,28 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable migrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName) { + TableResourcesInner client = this.inner(); + return client.migrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + + @Override + public Observable migrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName) { + TableResourcesInner client = this.inner(); + return client.migrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName) + .map(new Func1() { + @Override + public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner) { + return new ThroughputSettingsGetResultsImpl(inner, manager()); + } + }); + } + } diff --git a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/TableResourcesInner.java b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/TableResourcesInner.java index 68c96e06a26a5..38c7987c39669 100644 --- a/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/TableResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/TableResourcesInner.java @@ -26,6 +26,7 @@ import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.Response; @@ -94,12 +95,28 @@ interface TableResourcesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default") Observable> beginUpdateTableThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @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.v2020_03_01.TableResources migrateTableToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale") + Observable> migrateTableToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @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.v2020_03_01.TableResources beginMigrateTableToAutoscale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale") + Observable> beginMigrateTableToAutoscale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @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.v2020_03_01.TableResources migrateTableToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput") + Observable> migrateTableToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @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.v2020_03_01.TableResources beginMigrateTableToManualThroughput" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput") + Observable> beginMigrateTableToManualThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** * Lists the Tables under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -113,7 +130,7 @@ public List listTables(String resourceGroupName, String ac /** * Lists the Tables under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 @@ -126,7 +143,7 @@ public ServiceFuture> listTablesAsync(String resource /** * Lists the Tables under an existing Azure Cosmos DB database account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<TableGetResultsInner> object @@ -143,7 +160,7 @@ public List call(ServiceResponse> listTablesDelegate(Respo /** * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -203,7 +220,7 @@ public TableGetResultsInner getTable(String resourceGroupName, String accountNam /** * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -217,7 +234,7 @@ public ServiceFuture getTableAsync(String resourceGroupNam /** * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -235,7 +252,7 @@ public TableGetResultsInner call(ServiceResponse response) /** * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -279,7 +296,7 @@ private ServiceResponse getTableDelegate(Response createUpdateTableAsync(String resourc /** * Create or update an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param createUpdateTableParameters The parameters to provide for the current Table. @@ -329,7 +346,7 @@ public TableGetResultsInner call(ServiceResponse response) /** * Create or update an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param createUpdateTableParameters The parameters to provide for the current Table. @@ -361,7 +378,7 @@ public Observable> createUpdateTableWithSe /** * Create or update an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param createUpdateTableParameters The parameters to provide for the current Table. @@ -377,7 +394,7 @@ public TableGetResultsInner beginCreateUpdateTable(String resourceGroupName, Str /** * Create or update an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param createUpdateTableParameters The parameters to provide for the current Table. @@ -392,7 +409,7 @@ public ServiceFuture beginCreateUpdateTableAsync(String re /** * Create or update an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param createUpdateTableParameters The parameters to provide for the current Table. @@ -411,7 +428,7 @@ public TableGetResultsInner call(ServiceResponse response) /** * Create or update an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param createUpdateTableParameters The parameters to provide for the current Table. @@ -461,7 +478,7 @@ private ServiceResponse beginCreateUpdateTableDelegate(Res /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -475,7 +492,7 @@ public void deleteTable(String resourceGroupName, String accountName, String tab /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -489,7 +506,7 @@ public ServiceFuture deleteTableAsync(String resourceGroupName, String acc /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -507,7 +524,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -534,7 +551,7 @@ public Observable> deleteTableWithServiceResponseAsync(Str /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -548,7 +565,7 @@ public void beginDeleteTable(String resourceGroupName, String accountName, Strin /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -562,7 +579,7 @@ public ServiceFuture beginDeleteTableAsync(String resourceGroupName, Strin /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -580,7 +597,7 @@ public Void call(ServiceResponse response) { /** * Deletes an existing Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -625,7 +642,7 @@ private ServiceResponse beginDeleteTableDelegate(Response re /** * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -640,7 +657,7 @@ public ThroughputSettingsGetResultsInner getTableThroughput(String resourceGroup /** * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -654,7 +671,7 @@ public ServiceFuture getTableThroughputAsync( /** * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -672,7 +689,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse getTableThroughputDel /** * Update RUs per second of an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. @@ -732,7 +749,7 @@ public ThroughputSettingsGetResultsInner updateTableThroughput(String resourceGr /** * Update RUs per second of an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. @@ -747,7 +764,7 @@ public ServiceFuture updateTableThroughputAsy /** * Update RUs per second of an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. @@ -766,7 +783,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse> updateTabl /** * Update RUs per second of an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. @@ -814,7 +831,7 @@ public ThroughputSettingsGetResultsInner beginUpdateTableThroughput(String resou /** * Update RUs per second of an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. @@ -829,7 +846,7 @@ public ServiceFuture beginUpdateTableThroughp /** * Update RUs per second of an Azure Cosmos DB Table. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. @@ -848,7 +865,7 @@ public ThroughputSettingsGetResultsInner call(ServiceResponse beginUpdateTableThrou .build(response); } + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 migrateTableToAutoscale(String resourceGroupName, String accountName, String tableName) { + return migrateTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().last().body(); + } + + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 migrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable migrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName) { + return migrateTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> migrateTableToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + Observable> observable = service.migrateTableToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName) { + return beginMigrateTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 beginMigrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable beginMigrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName) { + return beginMigrateTableToAutoscaleWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable> beginMigrateTableToAutoscaleWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.beginMigrateTableToAutoscale(this.client.subscriptionId(), resourceGroupName, accountName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginMigrateTableToAutoscaleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginMigrateTableToAutoscaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 migrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName) { + return migrateTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().last().body(); + } + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 migrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable migrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName) { + return migrateTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> migrateTableToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + Observable> observable = service.migrateTableToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName) { + return beginMigrateTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 beginMigrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginMigrateTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable beginMigrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName) { + return beginMigrateTableToManualThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, ThroughputSettingsGetResultsInner>() { + @Override + public ThroughputSettingsGetResultsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputSettingsGetResultsInner object + */ + public Observable> beginMigrateTableToManualThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + final String apiVersion = "2020-03-01"; + return service.beginMigrateTableToManualThroughput(this.client.subscriptionId(), resourceGroupName, accountName, tableName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginMigrateTableToManualThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginMigrateTableToManualThroughputDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + }