diff --git a/eng/mgmt/api-specs.json b/eng/mgmt/api-specs.json index 51ef794352846..5341d48ccfb1d 100644 --- a/eng/mgmt/api-specs.json +++ b/eng/mgmt/api-specs.json @@ -150,6 +150,10 @@ "source": "specification/hdinsight/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "hybridcompute/resource-manager": { + "source": "specification/hybridcompute/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "iotcentral/resource-manager": { "source": "specification/iotcentral/resource-manager/readme.md", "args": "--multiapi --fluent", diff --git a/sdk/cosmos/mgmt-v2020_04_01/pom.xml b/sdk/cosmos/mgmt-v2020_04_01/pom.xml index 2aa10161113fc..1a75964a2963a 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/pom.xml +++ b/sdk/cosmos/mgmt-v2020_04_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.3.1 + 1.3.2 ../../parents/azure-arm-parent/pom.xml azure-mgmt-cosmosdb - 1.0.0-beta + 1.0.0-beta-1 jar Microsoft Azure SDK for CosmosDB Management This package contains Microsoft CosmosDB Management SDK. diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/CassandraResources.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/CassandraResources.java index b57596baf3bc5..bdb0748991846 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/CassandraResources.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/CassandraResources.java @@ -86,6 +86,28 @@ 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. * @@ -111,6 +133,30 @@ 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. * diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/CorsPolicy.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/CorsPolicy.java new file mode 100644 index 0000000000000..1866c969b88ea --- /dev/null +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/CorsPolicy.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2020_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CORS policy for the Cosmos DB database account. + */ +public class CorsPolicy { + /** + * The origin domains that are permitted to make a request against the + * service via CORS. + */ + @JsonProperty(value = "allowedOrigins", required = true) + private String allowedOrigins; + + /** + * The methods (HTTP request verbs) that the origin domain may use for a + * CORS request. + */ + @JsonProperty(value = "allowedMethods") + private String allowedMethods; + + /** + * The request headers that the origin domain may specify on the CORS + * request. + */ + @JsonProperty(value = "allowedHeaders") + private String allowedHeaders; + + /** + * The response headers that may be sent in the response to the CORS + * request and exposed by the browser to the request issuer. + */ + @JsonProperty(value = "exposedHeaders") + private String exposedHeaders; + + /** + * The maximum amount time that a browser should cache the preflight + * OPTIONS request. + */ + @JsonProperty(value = "maxAgeInSeconds") + private Long maxAgeInSeconds; + + /** + * Get the origin domains that are permitted to make a request against the service via CORS. + * + * @return the allowedOrigins value + */ + public String allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the origin domains that are permitted to make a request against the service via CORS. + * + * @param allowedOrigins the allowedOrigins value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedOrigins(String allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get the methods (HTTP request verbs) that the origin domain may use for a CORS request. + * + * @return the allowedMethods value + */ + public String allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the methods (HTTP request verbs) that the origin domain may use for a CORS request. + * + * @param allowedMethods the allowedMethods value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedMethods(String allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the request headers that the origin domain may specify on the CORS request. + * + * @return the allowedHeaders value + */ + public String allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set the request headers that the origin domain may specify on the CORS request. + * + * @param allowedHeaders the allowedHeaders value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedHeaders(String allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + + /** + * Get the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + * + * @return the exposedHeaders value + */ + public String exposedHeaders() { + return this.exposedHeaders; + } + + /** + * Set the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + * + * @param exposedHeaders the exposedHeaders value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withExposedHeaders(String exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Get the maximum amount time that a browser should cache the preflight OPTIONS request. + * + * @return the maxAgeInSeconds value + */ + public Long maxAgeInSeconds() { + return this.maxAgeInSeconds; + } + + /** + * Set the maximum amount time that a browser should cache the preflight OPTIONS request. + * + * @param maxAgeInSeconds the maxAgeInSeconds value to set + * @return the CorsPolicy object itself. + */ + public CorsPolicy withMaxAgeInSeconds(Long maxAgeInSeconds) { + this.maxAgeInSeconds = maxAgeInSeconds; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountCreateUpdateParameters.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountCreateUpdateParameters.java index a1a62a59f65b0..558df78d3a46c 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountCreateUpdateParameters.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountCreateUpdateParameters.java @@ -134,6 +134,12 @@ public class DatabaseAccountCreateUpdateParameters extends ARMResourceProperties @JsonProperty(value = "properties.enableAnalyticalStorage") private Boolean enableAnalyticalStorage; + /** + * The CORS policy for the Cosmos DB database account. + */ + @JsonProperty(value = "properties.cors") + private List cors; + /** * Creates an instance of DatabaseAccountCreateUpdateParameters class. * @param locations an array that contains the georeplication locations enabled for the Cosmos DB account. @@ -502,4 +508,24 @@ public DatabaseAccountCreateUpdateParameters withEnableAnalyticalStorage(Boolean return this; } + /** + * Get the CORS policy for the Cosmos DB database account. + * + * @return the cors value + */ + public List cors() { + return this.cors; + } + + /** + * Set the CORS policy for the Cosmos DB database account. + * + * @param cors the cors value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withCors(List cors) { + this.cors = cors; + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountGetResults.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountGetResults.java index a97772fb66ae4..efbf2f519fba1 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountGetResults.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountGetResults.java @@ -45,6 +45,11 @@ public interface DatabaseAccountGetResults extends HasInner cors(); + /** * @return the databaseAccountOfferType value. */ @@ -239,6 +244,18 @@ interface WithConsistencyPolicy { WithCreate withConsistencyPolicy(ConsistencyPolicy consistencyPolicy); } + /** + * The stage of the databaseaccountgetresults definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors The CORS policy for the Cosmos DB database account + * @return the next definition stage + */ + WithCreate withCors(List cors); + } + /** * The stage of the databaseaccountgetresults definition allowing to specify DisableKeyBasedMetadataWriteAccess. */ @@ -388,13 +405,13 @@ interface WithVirtualNetworkRules { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithApiProperties, DefinitionStages.WithCapabilities, DefinitionStages.WithConnectorOffer, DefinitionStages.WithConsistencyPolicy, DefinitionStages.WithDisableKeyBasedMetadataWriteAccess, DefinitionStages.WithEnableAnalyticalStorage, DefinitionStages.WithEnableAutomaticFailover, DefinitionStages.WithEnableCassandraConnector, DefinitionStages.WithEnableFreeTier, DefinitionStages.WithEnableMultipleWriteLocations, DefinitionStages.WithIpRules, DefinitionStages.WithIsVirtualNetworkFilterEnabled, DefinitionStages.WithKeyVaultKeyUri, DefinitionStages.WithKind, DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithVirtualNetworkRules { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithApiProperties, DefinitionStages.WithCapabilities, DefinitionStages.WithConnectorOffer, DefinitionStages.WithConsistencyPolicy, DefinitionStages.WithCors, DefinitionStages.WithDisableKeyBasedMetadataWriteAccess, DefinitionStages.WithEnableAnalyticalStorage, DefinitionStages.WithEnableAutomaticFailover, DefinitionStages.WithEnableCassandraConnector, DefinitionStages.WithEnableFreeTier, DefinitionStages.WithEnableMultipleWriteLocations, DefinitionStages.WithIpRules, DefinitionStages.WithIsVirtualNetworkFilterEnabled, DefinitionStages.WithKeyVaultKeyUri, DefinitionStages.WithKind, DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithVirtualNetworkRules { } } /** * The template for a DatabaseAccountGetResults update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApiProperties, UpdateStages.WithCapabilities, UpdateStages.WithConnectorOffer, UpdateStages.WithConsistencyPolicy, UpdateStages.WithDisableKeyBasedMetadataWriteAccess, UpdateStages.WithEnableAnalyticalStorage, UpdateStages.WithEnableAutomaticFailover, UpdateStages.WithEnableCassandraConnector, UpdateStages.WithEnableFreeTier, UpdateStages.WithEnableMultipleWriteLocations, UpdateStages.WithIpRules, UpdateStages.WithIsVirtualNetworkFilterEnabled, UpdateStages.WithKeyVaultKeyUri, UpdateStages.WithLocations, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithVirtualNetworkRules { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApiProperties, UpdateStages.WithCapabilities, UpdateStages.WithConnectorOffer, UpdateStages.WithConsistencyPolicy, UpdateStages.WithCors, UpdateStages.WithDisableKeyBasedMetadataWriteAccess, UpdateStages.WithEnableAnalyticalStorage, UpdateStages.WithEnableAutomaticFailover, UpdateStages.WithEnableCassandraConnector, UpdateStages.WithEnableFreeTier, UpdateStages.WithEnableMultipleWriteLocations, UpdateStages.WithIpRules, UpdateStages.WithIsVirtualNetworkFilterEnabled, UpdateStages.WithKeyVaultKeyUri, UpdateStages.WithLocations, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithVirtualNetworkRules { } /** @@ -449,6 +466,18 @@ interface WithConsistencyPolicy { Update withConsistencyPolicy(ConsistencyPolicy consistencyPolicy); } + /** + * The stage of the databaseaccountgetresults update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors The CORS policy for the Cosmos DB database account + * @return the next update stage + */ + Update withCors(List cors); + } + /** * The stage of the databaseaccountgetresults update allowing to specify DisableKeyBasedMetadataWriteAccess. */ diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountUpdateParameters.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountUpdateParameters.java index 8efc3eb440ce6..86b143dcdac50 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountUpdateParameters.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/DatabaseAccountUpdateParameters.java @@ -133,6 +133,12 @@ public class DatabaseAccountUpdateParameters { @JsonProperty(value = "properties.enableAnalyticalStorage") private Boolean enableAnalyticalStorage; + /** + * The CORS policy for the Cosmos DB database account. + */ + @JsonProperty(value = "properties.cors") + private List cors; + /** * Get the tags value. * @@ -493,4 +499,24 @@ public DatabaseAccountUpdateParameters withEnableAnalyticalStorage(Boolean enabl return this; } + /** + * Get the CORS policy for the Cosmos DB database account. + * + * @return the cors value + */ + public List cors() { + return this.cors; + } + + /** + * Set the CORS policy for the Cosmos DB database account. + * + * @param cors the cors value to set + * @return the DatabaseAccountUpdateParameters object itself. + */ + public DatabaseAccountUpdateParameters withCors(List cors) { + this.cors = cors; + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/GremlinResources.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/GremlinResources.java index 77259beec2592..de21aa345d6f9 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/GremlinResources.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/GremlinResources.java @@ -86,6 +86,28 @@ public interface GremlinResources { */ Observable 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. * @@ -111,6 +133,30 @@ 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. * diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/MongoDBResources.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/MongoDBResources.java index e27707a4d6f1c..fd27ac118427e 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/MongoDBResources.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/MongoDBResources.java @@ -86,6 +86,28 @@ 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. * @@ -111,6 +133,30 @@ 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. * diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlContainerGetPropertiesResource.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlContainerGetPropertiesResource.java index 863a154bc6860..353c846981219 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlContainerGetPropertiesResource.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlContainerGetPropertiesResource.java @@ -54,6 +54,12 @@ public class SqlContainerGetPropertiesResource { @JsonProperty(value = "conflictResolutionPolicy") private ConflictResolutionPolicy conflictResolutionPolicy; + /** + * Analytical TTL. + */ + @JsonProperty(value = "analyticalStorageTtl") + private Long analyticalStorageTtl; + /** * A system generated property. A unique identifier. */ @@ -194,6 +200,26 @@ public SqlContainerGetPropertiesResource withConflictResolutionPolicy(ConflictRe return this; } + /** + * Get analytical TTL. + * + * @return the analyticalStorageTtl value + */ + public Long analyticalStorageTtl() { + return this.analyticalStorageTtl; + } + + /** + * Set analytical TTL. + * + * @param analyticalStorageTtl the analyticalStorageTtl value to set + * @return the SqlContainerGetPropertiesResource object itself. + */ + public SqlContainerGetPropertiesResource withAnalyticalStorageTtl(Long analyticalStorageTtl) { + this.analyticalStorageTtl = analyticalStorageTtl; + return this; + } + /** * Get a system generated property. A unique identifier. * diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlContainerResource.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlContainerResource.java index c45ef41f54bfc..ad94b195f2396 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlContainerResource.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlContainerResource.java @@ -54,6 +54,12 @@ public class SqlContainerResource { @JsonProperty(value = "conflictResolutionPolicy") private ConflictResolutionPolicy conflictResolutionPolicy; + /** + * Analytical TTL. + */ + @JsonProperty(value = "analyticalStorageTtl") + private Long analyticalStorageTtl; + /** * Get name of the Cosmos DB SQL container. * @@ -174,4 +180,24 @@ public SqlContainerResource withConflictResolutionPolicy(ConflictResolutionPolic return this; } + /** + * Get analytical TTL. + * + * @return the analyticalStorageTtl value + */ + public Long analyticalStorageTtl() { + return this.analyticalStorageTtl; + } + + /** + * Set analytical TTL. + * + * @param analyticalStorageTtl the analyticalStorageTtl value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withAnalyticalStorageTtl(Long analyticalStorageTtl) { + this.analyticalStorageTtl = analyticalStorageTtl; + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlResources.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlResources.java index b97352057e875..86c03ec7d27a7 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlResources.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/SqlResources.java @@ -110,6 +110,28 @@ public interface SqlResources { */ Observable 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. * @@ -135,6 +157,30 @@ 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. * diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/TableResources.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/TableResources.java index 34f5422e1f7ea..682390484b5f1 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/TableResources.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/TableResources.java @@ -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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/CassandraResourcesImpl.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/CassandraResourcesImpl.java index 49a109f57a823..c8f07d955bc58 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/CassandraResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/CassandraResourcesInner.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/CassandraResourcesInner.java index b03a9f822b0e3..910a2aa9099c0 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/CassandraResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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_04_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_04_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_04_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_04_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_04_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,6 +148,22 @@ 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_04_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_04_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_04_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_04_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); + } /** @@ -933,7 +966,7 @@ private 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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -941,14 +974,14 @@ private ServiceResponse beginUpdateCassandraK * @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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -957,38 +990,38 @@ public List listCassandraTables(String resourceGr * @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 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 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-04-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 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 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 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 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-04-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 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 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 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 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-04-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 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 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 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 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-04-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 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 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 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 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,16 +1366,35 @@ 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-04-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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1412,13 +1403,14 @@ public Observable> deleteCassandraTableWithServiceResponse * @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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account 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 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 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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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,16 +2151,16 @@ 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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1512,12 +2171,12 @@ 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-04-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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1541,8 +2281,8 @@ public ServiceFuture getCassandraTableThrough * @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,7 +2291,7 @@ 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-04-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 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 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 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-04-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 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 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 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-04-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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountGetResultsImpl.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountGetResultsImpl.java index e3e7d59bf2f3d..340b74b4c5c8f 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountGetResultsImpl.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountGetResultsImpl.java @@ -18,6 +18,7 @@ import com.microsoft.azure.management.cosmosdb.v2020_04_01.Capability; import com.microsoft.azure.management.cosmosdb.v2020_04_01.ConnectorOffer; import com.microsoft.azure.management.cosmosdb.v2020_04_01.ConsistencyPolicy; +import com.microsoft.azure.management.cosmosdb.v2020_04_01.CorsPolicy; import com.microsoft.azure.management.cosmosdb.v2020_04_01.DatabaseAccountOfferType; import com.microsoft.azure.management.cosmosdb.v2020_04_01.FailoverPolicy; import com.microsoft.azure.management.cosmosdb.v2020_04_01.IpAddressOrRange; @@ -104,6 +105,11 @@ public ConsistencyPolicy consistencyPolicy() { return this.inner().consistencyPolicy(); } + @Override + public List cors() { + return this.inner().cors(); + } + @Override public DatabaseAccountOfferType databaseAccountOfferType() { return this.inner().databaseAccountOfferType(); @@ -272,6 +278,16 @@ public DatabaseAccountGetResultsImpl withConsistencyPolicy(ConsistencyPolicy con return this; } + @Override + public DatabaseAccountGetResultsImpl withCors(List cors) { + if (isInCreateMode()) { + this.createParameter.withCors(cors); + } else { + this.updateParameter.withCors(cors); + } + return this; + } + @Override public DatabaseAccountGetResultsImpl withDisableKeyBasedMetadataWriteAccess(Boolean disableKeyBasedMetadataWriteAccess) { if (isInCreateMode()) { diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountGetResultsInner.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountGetResultsInner.java index ad9590bdaa2f7..63089651b9202 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountGetResultsInner.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountGetResultsInner.java @@ -20,6 +20,7 @@ import com.microsoft.azure.management.cosmosdb.v2020_04_01.ConnectorOffer; import com.microsoft.azure.management.cosmosdb.v2020_04_01.PublicNetworkAccess; import com.microsoft.azure.management.cosmosdb.v2020_04_01.ApiProperties; +import com.microsoft.azure.management.cosmosdb.v2020_04_01.CorsPolicy; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.management.cosmosdb.v2020_04_01.ARMResourceProperties; @@ -185,6 +186,12 @@ public class DatabaseAccountGetResultsInner extends ARMResourceProperties { @JsonProperty(value = "properties.enableAnalyticalStorage") private Boolean enableAnalyticalStorage; + /** + * The CORS policy for the Cosmos DB database account. + */ + @JsonProperty(value = "properties.cors") + private List cors; + /** * Get indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. * @@ -588,4 +595,24 @@ public DatabaseAccountGetResultsInner withEnableAnalyticalStorage(Boolean enable return this; } + /** + * Get the CORS policy for the Cosmos DB database account. + * + * @return the cors value + */ + public List cors() { + return this.cors; + } + + /** + * Set the CORS policy for the Cosmos DB database account. + * + * @param cors the cors value to set + * @return the DatabaseAccountGetResultsInner object itself. + */ + public DatabaseAccountGetResultsInner withCors(List cors) { + this.cors = cors; + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountsInner.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountsInner.java index e710b09f1e423..037db3c8ffe85 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountsInner.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/DatabaseAccountsInner.java @@ -254,7 +254,6 @@ public Observable> 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); } diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/GremlinResourcesImpl.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/GremlinResourcesImpl.java index db6799e3645cb..a0636b30d9a48 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/GremlinResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/GremlinResourcesImpl.java @@ -139,6 +139,30 @@ public ThroughputSettingsGetResults call(ThroughputSettingsGetResultsInner inner }); } + @Override + public Observable 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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/GremlinResourcesInner.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/GremlinResourcesInner.java index fabfd72a12776..69eca22179b85 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/GremlinResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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_04_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_04_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_04_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_04_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_04_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,6 +148,22 @@ 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_04_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_04_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_04_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_04_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); + } /** @@ -933,7 +966,7 @@ private 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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -941,14 +974,14 @@ private ServiceResponse beginUpdateGremlinDat * @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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -957,38 +990,38 @@ public List listGremlinGraphs(String resourceGroupN * @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 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 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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,16 +1366,35 @@ 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-04-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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1412,13 +1403,14 @@ public Observable> deleteGremlinGraphWithServiceResponseAs * @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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account 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 The 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 The 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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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,16 +2151,16 @@ 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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1512,12 +2171,12 @@ 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-04-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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1541,8 +2281,8 @@ public ServiceFuture getGremlinGraphThroughpu * @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,7 +2291,7 @@ 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-04-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 The 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 The 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 The 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-04-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 The 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 The 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 The 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-04-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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/MongoDBResourcesImpl.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/MongoDBResourcesImpl.java index b2d376f77434d..d6fb6a43efc57 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/MongoDBResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/MongoDBResourcesInner.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/MongoDBResourcesInner.java index 979a38db98b11..0b9331d6d22ea 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/MongoDBResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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_04_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_04_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_04_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_04_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_04_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,6 +148,22 @@ 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_04_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_04_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_04_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_04_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); + } /** @@ -933,7 +966,7 @@ private 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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -941,14 +974,14 @@ private ServiceResponse beginUpdateMongoDBDat * @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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -957,38 +990,38 @@ public List listMongoDBCollections(String reso * @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 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 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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,16 +1366,35 @@ 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-04-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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1412,13 +1403,14 @@ public Observable> deleteMongoDBCollectionWithServiceRespo * @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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account 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 The 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 The 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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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,16 +2151,16 @@ 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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1512,12 +2171,12 @@ 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-04-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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1541,8 +2281,8 @@ public ServiceFuture getMongoDBCollectionThro * @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,7 +2291,7 @@ 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-04-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 The 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 The 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 The 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-04-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 The 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 The 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 The 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-04-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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/NotebookWorkspaceImpl.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/NotebookWorkspaceImpl.java index 4c01df157a501..526c33ed2ba2c 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/NotebookWorkspaceImpl.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/NotebookWorkspaceImpl.java @@ -10,7 +10,6 @@ import com.microsoft.azure.management.cosmosdb.v2020_04_01.NotebookWorkspace; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; -import com.microsoft.azure.management.cosmosdb.v2020_04_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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/NotebookWorkspacesInner.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/NotebookWorkspacesInner.java index c81824ff39bfd..daf2e19bac0c8 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/NotebookWorkspacesInner.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/NotebookWorkspacesInner.java @@ -288,8 +288,8 @@ 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); } /** @@ -313,8 +313,8 @@ public ServiceFuture createOrUpdateAsync(String resource * @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(); @@ -330,7 +330,7 @@ public NotebookWorkspaceInner call(ServiceResponse respo * @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."); } @@ -342,7 +342,7 @@ public Observable> createOrUpdateWithSer } final String notebookWorkspaceName = "default"; final String apiVersion = "2020-04-01"; - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), notebookCreateUpdateParameters, this.client.userAgent()); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), new NotebookWorkspaceCreateUpdateParameters(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -356,8 +356,8 @@ public Observable> createOrUpdateWithSer * @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(); } /** @@ -369,8 +369,8 @@ public NotebookWorkspaceInner beginCreateOrUpdate(String resourceGroupName, Stri * @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); } /** @@ -381,8 +381,8 @@ public ServiceFuture beginCreateOrUpdateAsync(String res * @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(); @@ -398,7 +398,7 @@ public NotebookWorkspaceInner call(ServiceResponse respo * @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."); } @@ -410,7 +410,7 @@ public Observable> beginCreateOrUpdateWi } final String notebookWorkspaceName = "default"; final String apiVersion = "2020-04-01"; - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), notebookCreateUpdateParameters, this.client.userAgent()) + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), new NotebookWorkspaceCreateUpdateParameters(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/SqlResourcesImpl.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/SqlResourcesImpl.java index 7092e77775c82..662ce4a71fa0a 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/SqlResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/SqlResourcesInner.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/SqlResourcesInner.java index ca64de0427aed..8d24c33244e57 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/SqlResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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_04_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_04_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_04_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_04_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_04_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_04_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_04_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_04_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_04_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_04_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); @@ -1008,7 +1041,7 @@ private 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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1016,14 +1049,14 @@ private ServiceResponse beginUpdateSqlDatabas * @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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1032,38 +1065,38 @@ public List listSqlContainers(String resourceGroupN * @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 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 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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-04-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 The 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 The 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 The 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 The 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,16 +1441,35 @@ 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-04-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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1487,13 +1478,14 @@ public Observable> deleteSqlContainerWithServiceResponseAs * @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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account 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 The 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 The 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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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,16 +2226,16 @@ 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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1587,12 +2246,12 @@ 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-04-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 The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -1616,8 +2356,8 @@ public ServiceFuture getSqlContainerThroughpu * @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,7 +2366,7 @@ 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-04-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 The 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 The 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 The 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-04-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 The 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 The 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 The 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-04-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()) diff --git a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/TableResourcesImpl.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/TableResourcesImpl.java index 1ad60c1bab665..9fd7098dd4bb3 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/TableResourcesImpl.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/TableResourcesInner.java b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/TableResourcesInner.java index 39bda1b218b99..e03be810c0f52 100644 --- a/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_01/implementation/TableResourcesInner.java +++ b/sdk/cosmos/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_04_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,6 +95,22 @@ 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_04_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_04_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_04_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_04_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); + } /** @@ -895,4 +912,336 @@ private 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-04-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-04-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-04-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-04-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); + } + } diff --git a/sdk/hybridcompute/ci.mgmt.yml b/sdk/hybridcompute/ci.mgmt.yml new file mode 100644 index 0000000000000..4f6089dafaddf --- /dev/null +++ b/sdk/hybridcompute/ci.mgmt.yml @@ -0,0 +1,26 @@ +trigger: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ + +stages: + - template: ../../eng/pipelines/templates/stages/archetype-sdk-management.yml + parameters: + ServiceDirectory: hybridcompute diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/pom.xml b/sdk/hybridcompute/mgmt-v2019_12_12/pom.xml new file mode 100644 index 0000000000000..2679712145888 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.hybridcompute.v2019_12_12 + + com.microsoft.azure + azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-hybridcompute + 1.0.0-beta + jar + Microsoft Azure SDK for HybridCompute Management + This package contains Microsoft HybridCompute Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/AzureEntityResource.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/AzureEntityResource.java new file mode 100644 index 0000000000000..5feb29ec9b9f8 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorAdditionalInfo.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..c5662a1187fd9 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorAdditionalInfo.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorDetail.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorDetail.java new file mode 100644 index 0000000000000..4883fe7d3e376 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorDetail.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorDetail { + /** + * The error's code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A human readable error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Indicates which property in the request is responsible for the error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Additional error details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the error's code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error's code. + * + * @param code the code value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a human readable error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a human readable error message. + * + * @param message the message value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get indicates which property in the request is responsible for the error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set indicates which property in the request is responsible for the error. + * + * @param target the target value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get additional error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set additional error details. + * + * @param details the details value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponse.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponse.java new file mode 100644 index 0000000000000..d9b626a533e7a --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponse.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error response. + */ +public class ErrorResponse { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponseException.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponseException.java new file mode 100644 index 0000000000000..234287d3b06bb --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Identity.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Identity.java new file mode 100644 index 0000000000000..da9ccc93d4a3d --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Identity.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/InstanceViewTypes.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/InstanceViewTypes.java new file mode 100644 index 0000000000000..841d0596ca94c --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/InstanceViewTypes.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InstanceViewTypes. + */ +public final class InstanceViewTypes extends ExpandableStringEnum { + /** Static value instanceView for InstanceViewTypes. */ + public static final InstanceViewTypes INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates or finds a InstanceViewTypes from its string representation. + * @param name a name to look for + * @return the corresponding InstanceViewTypes + */ + @JsonCreator + public static InstanceViewTypes fromString(String name) { + return fromString(name, InstanceViewTypes.class); + } + + /** + * @return known InstanceViewTypes values + */ + public static Collection values() { + return values(InstanceViewTypes.class); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/LocationData.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/LocationData.java new file mode 100644 index 0000000000000..a09ea421fc3e7 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/LocationData.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata pertaining to the geographic location of the resource. + */ +public class LocationData { + /** + * A canonical name for the geographic or physical location. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The city or locality where the resource is located. + */ + @JsonProperty(value = "city") + private String city; + + /** + * The district, state, or province where the resource is located. + */ + @JsonProperty(value = "district") + private String district; + + /** + * The country or region where the resource is located. + */ + @JsonProperty(value = "countryOrRegion") + private String countryOrRegion; + + /** + * Get a canonical name for the geographic or physical location. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set a canonical name for the geographic or physical location. + * + * @param name the name value to set + * @return the LocationData object itself. + */ + public LocationData withName(String name) { + this.name = name; + return this; + } + + /** + * Get the city or locality where the resource is located. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the city or locality where the resource is located. + * + * @param city the city value to set + * @return the LocationData object itself. + */ + public LocationData withCity(String city) { + this.city = city; + return this; + } + + /** + * Get the district, state, or province where the resource is located. + * + * @return the district value + */ + public String district() { + return this.district; + } + + /** + * Set the district, state, or province where the resource is located. + * + * @param district the district value to set + * @return the LocationData object itself. + */ + public LocationData withDistrict(String district) { + this.district = district; + return this; + } + + /** + * Get the country or region where the resource is located. + * + * @return the countryOrRegion value + */ + public String countryOrRegion() { + return this.countryOrRegion; + } + + /** + * Set the country or region where the resource is located. + * + * @param countryOrRegion the countryOrRegion value to set + * @return the LocationData object itself. + */ + public LocationData withCountryOrRegion(String countryOrRegion) { + this.countryOrRegion = countryOrRegion; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machine.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machine.java new file mode 100644 index 0000000000000..d6cdd74951cfe --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machine.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.HybridComputeManager; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.MachineInner; + +/** + * Type representing Machine. + */ +public interface Machine extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * @return the clientPublicKey value. + */ + String clientPublicKey(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the errorDetails value. + */ + List errorDetails(); + + /** + * @return the extensions value. + */ + List extensions(); + + /** + * @return the identity value. + */ + MachineIdentity identity(); + + /** + * @return the lastStatusChange value. + */ + DateTime lastStatusChange(); + + /** + * @return the locationData value. + */ + LocationData locationData(); + + /** + * @return the machineFqdn value. + */ + String machineFqdn(); + + /** + * @return the osName value. + */ + String osName(); + + /** + * @return the osProfile value. + */ + MachinePropertiesOsProfile osProfile(); + + /** + * @return the osVersion value. + */ + String osVersion(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the status value. + */ + StatusTypes status(); + + /** + * @return the vmId value. + */ + String vmId(); + + /** + * The entirety of the Machine definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Machine definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Machine definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Machine definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the machine definition allowing to specify ClientPublicKey. + */ + interface WithClientPublicKey { + /** + * Specifies clientPublicKey. + * @param clientPublicKey Public Key that the client provides to be used during initial resource onboarding + * @return the next definition stage + */ + WithCreate withClientPublicKey(String clientPublicKey); + } + + /** + * The stage of the machine definition allowing to specify Extensions. + */ + interface WithExtensions { + /** + * Specifies extensions. + * @param extensions Machine Extensions information + * @return the next definition stage + */ + WithCreate withExtensions(List extensions); + } + + /** + * The stage of the machine definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity the identity parameter value + * @return the next definition stage + */ + WithCreate withIdentity(MachineIdentity identity); + } + + /** + * The stage of the machine definition allowing to specify LocationData. + */ + interface WithLocationData { + /** + * Specifies locationData. + * @param locationData the locationData parameter value + * @return the next definition stage + */ + WithCreate withLocationData(LocationData locationData); + } + + /** + * The stage of the machine definition allowing to specify OsProfile. + */ + interface WithOsProfile { + /** + * Specifies osProfile. + * @param osProfile Specifies the operating system settings for the hybrid machine + * @return the next definition stage + */ + WithCreate withOsProfile(MachinePropertiesOsProfile osProfile); + } + + /** + * The stage of the machine definition allowing to specify VmId. + */ + interface WithVmId { + /** + * Specifies vmId. + * @param vmId Specifies the hybrid machine unique ID + * @return the next definition stage + */ + WithCreate withVmId(String vmId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithClientPublicKey, DefinitionStages.WithExtensions, DefinitionStages.WithIdentity, DefinitionStages.WithLocationData, DefinitionStages.WithOsProfile, DefinitionStages.WithVmId { + } + } + /** + * The template for a Machine update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithLocationData { + } + + /** + * Grouping of Machine update stages. + */ + interface UpdateStages { + /** + * The stage of the machine update allowing to specify LocationData. + */ + interface WithLocationData { + /** + * Specifies locationData. + * @param locationData the locationData parameter value + * @return the next update stage + */ + Update withLocationData(LocationData locationData); + } + + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtension.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtension.java new file mode 100644 index 0000000000000..b0fc0843ef7e3 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtension.java @@ -0,0 +1,360 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.MachineExtensionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.HybridComputeManager; +import java.util.Map; + +/** + * Type representing MachineExtension. + */ +public interface MachineExtension extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the instanceView value. + */ + MachineExtensionPropertiesInstanceView instanceView(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the machineExtensionType value. + */ + String machineExtensionType(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publisher value. + */ + String publisher(); + + /** + * @return the settings value. + */ + Object settings(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * The entirety of the MachineExtension definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMachine, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of MachineExtension definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MachineExtension definition. + */ + interface Blank extends WithMachine { + } + + /** + * The stage of the machineextension definition allowing to specify Machine. + */ + interface WithMachine { + /** + * Specifies resourceGroupName, name. + * @param resourceGroupName The name of the resource group + * @param name The name of the machine where the extension should be created or updated + * @return the next definition stage + */ + WithLocation withExistingMachine(String resourceGroupName, String name); + } + + /** + * The stage of the machineextension definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The geo-location where the resource lives + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the machineextension definition allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true + * @return the next definition stage + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the machineextension definition allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed + * @return the next definition stage + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the machineextension definition allowing to specify InstanceView. + */ + interface WithInstanceView { + /** + * Specifies instanceView. + * @param instanceView The machine extension instance view + * @return the next definition stage + */ + WithCreate withInstanceView(MachineExtensionPropertiesInstanceView instanceView); + } + + /** + * The stage of the machineextension definition allowing to specify MachineExtensionType. + */ + interface WithMachineExtensionType { + /** + * Specifies machineExtensionType. + * @param machineExtensionType Specifies the type of the extension; an example is "CustomScriptExtension" + * @return the next definition stage + */ + WithCreate withMachineExtensionType(String machineExtensionType); + } + + /** + * The stage of the machineextension definition allowing to specify ProtectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies protectedSettings. + * @param protectedSettings The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all + * @return the next definition stage + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the machineextension definition allowing to specify Publisher. + */ + interface WithPublisher { + /** + * Specifies publisher. + * @param publisher The name of the extension handler publisher + * @return the next definition stage + */ + WithCreate withPublisher(String publisher); + } + + /** + * The stage of the machineextension definition allowing to specify Settings. + */ + interface WithSettings { + /** + * Specifies settings. + * @param settings Json formatted public settings for the extension + * @return the next definition stage + */ + WithCreate withSettings(Object settings); + } + + /** + * The stage of the machineextension definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the machineextension definition allowing to specify TypeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies typeHandlerVersion. + * @param typeHandlerVersion Specifies the version of the script handler + * @return the next definition stage + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutoUpgradeMinorVersion, DefinitionStages.WithForceUpdateTag, DefinitionStages.WithInstanceView, DefinitionStages.WithMachineExtensionType, DefinitionStages.WithProtectedSettings, DefinitionStages.WithPublisher, DefinitionStages.WithSettings, DefinitionStages.WithTags, DefinitionStages.WithTypeHandlerVersion { + } + } + /** + * The template for a MachineExtension update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoUpgradeMinorVersion, UpdateStages.WithForceUpdateTag, UpdateStages.WithProtectedSettings, UpdateStages.WithPublisher, UpdateStages.WithSettings, UpdateStages.WithTags, UpdateStages.WithType, UpdateStages.WithTypeHandlerVersion { + } + + /** + * Grouping of MachineExtension update stages. + */ + interface UpdateStages { + /** + * The stage of the machineextension update allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true + * @return the next update stage + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the machineextension update allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed + * @return the next update stage + */ + Update withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the machineextension update allowing to specify ProtectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies protectedSettings. + * @param protectedSettings The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all + * @return the next update stage + */ + Update withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the machineextension update allowing to specify Publisher. + */ + interface WithPublisher { + /** + * Specifies publisher. + * @param publisher The name of the extension handler publisher + * @return the next update stage + */ + Update withPublisher(String publisher); + } + + /** + * The stage of the machineextension update allowing to specify Settings. + */ + interface WithSettings { + /** + * Specifies settings. + * @param settings Json formatted public settings for the extension + * @return the next update stage + */ + Update withSettings(Object settings); + } + + /** + * The stage of the machineextension update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the machineextension update allowing to specify Type. + */ + interface WithType { + /** + * Specifies type. + * @param type Specifies the type of the extension; an example is "CustomScriptExtension" + * @return the next update stage + */ + Update withType(String type); + } + + /** + * The stage of the machineextension update allowing to specify TypeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies typeHandlerVersion. + * @param typeHandlerVersion Specifies the version of the script handler + * @return the next update stage + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceView.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceView.java new file mode 100644 index 0000000000000..3460b1941ece7 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceView.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the Machine Extension Instance View. + */ +public class MachineExtensionInstanceView { + /** + * The machine extension name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Instance view status. + */ + @JsonProperty(value = "status") + private MachineExtensionInstanceViewStatus status; + + /** + * Get the machine extension name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the machine extension name. + * + * @param name the name value to set + * @return the MachineExtensionInstanceView object itself. + */ + public MachineExtensionInstanceView withName(String name) { + this.name = name; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the MachineExtensionInstanceView object itself. + */ + public MachineExtensionInstanceView withType(String type) { + this.type = type; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionInstanceView object itself. + */ + public MachineExtensionInstanceView withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get instance view status. + * + * @return the status value + */ + public MachineExtensionInstanceViewStatus status() { + return this.status; + } + + /** + * Set instance view status. + * + * @param status the status value to set + * @return the MachineExtensionInstanceView object itself. + */ + public MachineExtensionInstanceView withStatus(MachineExtensionInstanceViewStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceViewStatus.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceViewStatus.java new file mode 100644 index 0000000000000..84170e7f592d6 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceViewStatus.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Instance view status. + */ +public class MachineExtensionInstanceViewStatus { + /** + * The status code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The level code. Possible values include: 'Info', 'Warning', 'Error'. + */ + @JsonProperty(value = "level") + private StatusLevelTypes level; + + /** + * The short localizable label for the status. + */ + @JsonProperty(value = "displayStatus") + private String displayStatus; + + /** + * The detailed status message, including for alerts and error messages. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The time of the status. + */ + @JsonProperty(value = "time") + private DateTime time; + + /** + * Get the status code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the status code. + * + * @param code the code value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the level code. Possible values include: 'Info', 'Warning', 'Error'. + * + * @return the level value + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level code. Possible values include: 'Info', 'Warning', 'Error'. + * + * @param level the level value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withLevel(StatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Get the short localizable label for the status. + * + * @return the displayStatus value + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Set the short localizable label for the status. + * + * @param displayStatus the displayStatus value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withDisplayStatus(String displayStatus) { + this.displayStatus = displayStatus; + return this; + } + + /** + * Get the detailed status message, including for alerts and error messages. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the detailed status message, including for alerts and error messages. + * + * @param message the message value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the time of the status. + * + * @return the time value + */ + public DateTime time() { + return this.time; + } + + /** + * Set the time of the status. + * + * @param time the time value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withTime(DateTime time) { + this.time = time; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesInstanceView.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesInstanceView.java new file mode 100644 index 0000000000000..202d762e5ad59 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesInstanceView.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The machine extension instance view. + */ +public class MachineExtensionPropertiesInstanceView extends MachineExtensionInstanceView { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesModel.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesModel.java new file mode 100644 index 0000000000000..f0df0fe697f83 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesModel.java @@ -0,0 +1,246 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a Machine Extension. + */ +public class MachineExtensionPropertiesModel { + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The machine extension instance view. + */ + @JsonProperty(value = "instanceView") + private MachineExtensionPropertiesInstanceView instanceView; + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withType(String type) { + this.type = type; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the machine extension instance view. + * + * @return the instanceView value + */ + public MachineExtensionPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Set the machine extension instance view. + * + * @param instanceView the instanceView value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdate.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdate.java new file mode 100644 index 0000000000000..c8a49b9c60a0f --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdate.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a Machine Extension Update. + */ +@JsonFlatten +public class MachineExtensionUpdate extends UpdateResource { + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String type; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withType(String type) { + this.type = type; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdatePropertiesModel.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdatePropertiesModel.java new file mode 100644 index 0000000000000..de2da370a7c3c --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdatePropertiesModel.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a Machine Extension. + */ +public class MachineExtensionUpdatePropertiesModel { + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withType(String type) { + this.type = type; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensions.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensions.java new file mode 100644 index 0000000000000..75638745605a8 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensions.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.MachineExtensionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing MachineExtensions. + */ +public interface MachineExtensions extends SupportsCreating, HasInner { + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String name, String extensionName); + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String name); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String name, String extensionName); + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineIdentity.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineIdentity.java new file mode 100644 index 0000000000000..df3a34c71338b --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineIdentity.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The MachineIdentity model. + */ +public class MachineIdentity extends Identity { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineProperties.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineProperties.java new file mode 100644 index 0000000000000..520febc028b69 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineProperties.java @@ -0,0 +1,286 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a hybrid machine. + */ +public class MachineProperties { + /** + * The locationData property. + */ + @JsonProperty(value = "locationData") + private LocationData locationData; + + /** + * Specifies the operating system settings for the hybrid machine. + */ + @JsonProperty(value = "osProfile") + private MachinePropertiesOsProfile osProfile; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The status of the hybrid machine agent. Possible values include: + * 'Connected', 'Disconnected', 'Error'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private StatusTypes status; + + /** + * The time of the last status change. + */ + @JsonProperty(value = "lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastStatusChange; + + /** + * Details about the error state. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /** + * The hybrid machine agent full version. + */ + @JsonProperty(value = "agentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String agentVersion; + + /** + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /** + * Specifies the hybrid machine display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Specifies the hybrid machine FQDN. + */ + @JsonProperty(value = "machineFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String machineFqdn; + + /** + * Public Key that the client provides to be used during initial resource + * onboarding. + */ + @JsonProperty(value = "clientPublicKey") + private String clientPublicKey; + + /** + * The Operating System running on the hybrid machine. + */ + @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /** + * The version of Operating System running on the hybrid machine. + */ + @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osVersion; + + /** + * Machine Extensions information. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /** + * Get the locationData value. + * + * @return the locationData value + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData value. + * + * @param locationData the locationData value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + + /** + * Get specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value + */ + public MachinePropertiesOsProfile osProfile() { + return this.osProfile; + } + + /** + * Set specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withOsProfile(MachinePropertiesOsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the hybrid machine agent. Possible values include: 'Connected', 'Disconnected', 'Error'. + * + * @return the status value + */ + public StatusTypes status() { + return this.status; + } + + /** + * Get the time of the last status change. + * + * @return the lastStatusChange value + */ + public DateTime lastStatusChange() { + return this.lastStatusChange; + } + + /** + * Get details about the error state. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the hybrid machine agent full version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Get specifies the hybrid machine unique ID. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Set specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get specifies the hybrid machine display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get specifies the hybrid machine FQDN. + * + * @return the machineFqdn value + */ + public String machineFqdn() { + return this.machineFqdn; + } + + /** + * Get public Key that the client provides to be used during initial resource onboarding. + * + * @return the clientPublicKey value + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set public Key that the client provides to be used during initial resource onboarding. + * + * @param clientPublicKey the clientPublicKey value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + + /** + * Get the Operating System running on the hybrid machine. + * + * @return the osName value + */ + public String osName() { + return this.osName; + } + + /** + * Get the version of Operating System running on the hybrid machine. + * + * @return the osVersion value + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Get machine Extensions information. + * + * @return the extensions value + */ + public List extensions() { + return this.extensions; + } + + /** + * Set machine Extensions information. + * + * @param extensions the extensions value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachinePropertiesOsProfile.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachinePropertiesOsProfile.java new file mode 100644 index 0000000000000..92669e789ab0b --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachinePropertiesOsProfile.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * Specifies the operating system settings for the hybrid machine. + */ +public class MachinePropertiesOsProfile extends OSProfile { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnect.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnect.java new file mode 100644 index 0000000000000..a306652ba98eb --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnect.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a hybrid machine reconnect. + */ +@JsonFlatten +public class MachineReconnect { + /** + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "properties.vmId") + private String vmId; + + /** + * Public Key that the client provides to be used during initial resource + * onboarding. + */ + @JsonProperty(value = "properties.clientPublicKey") + private String clientPublicKey; + + /** + * Get specifies the hybrid machine unique ID. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Set specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set + * @return the MachineReconnect object itself. + */ + public MachineReconnect withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get public Key that the client provides to be used during initial resource onboarding. + * + * @return the clientPublicKey value + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set public Key that the client provides to be used during initial resource onboarding. + * + * @param clientPublicKey the clientPublicKey value to set + * @return the MachineReconnect object itself. + */ + public MachineReconnect withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnectProperties.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnectProperties.java new file mode 100644 index 0000000000000..c6e00b190d430 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnectProperties.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties required to reconnect a hybrid machine. + */ +public class MachineReconnectProperties { + /** + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /** + * Public Key that the client provides to be used during initial resource + * onboarding. + */ + @JsonProperty(value = "clientPublicKey") + private String clientPublicKey; + + /** + * Get specifies the hybrid machine unique ID. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Set specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set + * @return the MachineReconnectProperties object itself. + */ + public MachineReconnectProperties withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get public Key that the client provides to be used during initial resource onboarding. + * + * @return the clientPublicKey value + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set public Key that the client provides to be used during initial resource onboarding. + * + * @param clientPublicKey the clientPublicKey value to set + * @return the MachineReconnectProperties object itself. + */ + public MachineReconnectProperties withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdate.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdate.java new file mode 100644 index 0000000000000..d332ae997fe56 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdate.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a hybrid machine Update. + */ +@JsonFlatten +public class MachineUpdate extends UpdateResource { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "identity.principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "identity.tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "identity.type") + private ResourceIdentityType type; + + /** + * The locationData property. + */ + @JsonProperty(value = "properties.locationData") + private LocationData locationData; + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the MachineUpdate object itself. + */ + public MachineUpdate withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the locationData value. + * + * @return the locationData value + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData value. + * + * @param locationData the locationData value to set + * @return the MachineUpdate object itself. + */ + public MachineUpdate withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdateProperties.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdateProperties.java new file mode 100644 index 0000000000000..f64d484ad33da --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdateProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the ARM updatable properties of a hybrid machine. + */ +public class MachineUpdateProperties { + /** + * The locationData property. + */ + @JsonProperty(value = "locationData") + private LocationData locationData; + + /** + * Get the locationData value. + * + * @return the locationData value + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData value. + * + * @param locationData the locationData value to set + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machines.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machines.java new file mode 100644 index 0000000000000..c91e8ea1fe7e6 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machines.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.MachinesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Machines. + */ +public interface Machines extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable reconnectAsync(String resourceGroupName, String name, MachineReconnect parameters); + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OSProfile.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OSProfile.java new file mode 100644 index 0000000000000..5d206052040ab --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OSProfile.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the operating system settings for the hybrid machine. + */ +public class OSProfile { + /** + * Specifies the host OS name of the hybrid machine. + */ + @JsonProperty(value = "computerName", access = JsonProperty.Access.WRITE_ONLY) + private String computerName; + + /** + * Get specifies the host OS name of the hybrid machine. + * + * @return the computerName value + */ + public String computerName() { + return this.computerName; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValue.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValue.java new file mode 100644 index 0000000000000..c51b6533aac58 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValue.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.HybridComputeManager; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.OperationValueInner; + +/** + * Type representing OperationValue. + */ +public interface OperationValue extends HasInner, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the provider value. + */ + String provider(); + + /** + * @return the resource value. + */ + String resource(); + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValueDisplayModel.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValueDisplayModel.java new file mode 100644 index 0000000000000..c5e3357a4df96 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValueDisplayModel.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a Hybrid Compute Operation Value Display. + */ +public class OperationValueDisplayModel { + /** + * The display name of the compute operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The resource provider for the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Get the display name of the compute operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the display name of the resource the operation applies to. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the resource provider for the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Operations.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Operations.java new file mode 100644 index 0000000000000..8a011551e7fa8 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import rx.Observable; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Gets a list of hybrid compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Plan.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Plan.java new file mode 100644 index 0000000000000..94166bfd55e8e --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Plan.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Plan for the resource. + */ +public class Plan { + /** + * A user defined name of the 3rd Party Artifact that is being procured. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The publisher of the 3rd Party Artifact that is being bought. E.g. + * NewRelic. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /** + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product + * maps to the OfferID specified for the artifact at the time of Data + * Market onboarding. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /** + * A publisher provided promotion code as provisioned in Data Market for + * the said product/artifact. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /** + * The version of the desired product/artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get a user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set a user defined name of the 3rd Party Artifact that is being procured. + * + * @param name the name value to set + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @param publisher the publisher value to set + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value + */ + public String product() { + return this.product; + } + + /** + * Set the 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + * + * @param product the product value to set + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get a publisher provided promotion code as provisioned in Data Market for the said product/artifact. + * + * @return the promotionCode value + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set a publisher provided promotion code as provisioned in Data Market for the said product/artifact. + * + * @param promotionCode the promotionCode value to set + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version of the desired product/artifact. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the desired product/artifact. + * + * @param version the version value to set + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceIdentityType.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceIdentityType.java new file mode 100644 index 0000000000000..1cc632ddad61d --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceIdentityType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySet.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySet.java new file mode 100644 index 0000000000000..39518f24ed6f0 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySet.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The resource model definition containing the full set of allowed properties + * for a resource. Except properties bag, there cannot be a top level property + * outside of this set. + */ +public class ResourceModelWithAllowedPropertySet extends Resource { + /** + * The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another azure + * resource. If this is present, complete mode deployment will not delete + * the resource if it is removed from the template since it is managed by + * another resource. + */ + @JsonProperty(value = "managedBy") + private String managedBy; + + /** + * Metadata used by portal/tooling/etc to render different UX experiences + * for resources of the same type; e.g. ApiApps are a kind of + * Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The etag field is *not* required. If it is provided in the response + * body, it must also be provided as a header per the normal etag + * convention. Entity tags are used for comparing two or more entities + * from the same requested resource. HTTP/1.1 uses entity tags in the etag + * (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The identity property. + */ + @JsonProperty(value = "identity") + private ResourceModelWithAllowedPropertySetIdentity identity; + + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private ResourceModelWithAllowedPropertySetSku sku; + + /** + * The plan property. + */ + @JsonProperty(value = "plan") + private ResourceModelWithAllowedPropertySetPlan plan; + + /** + * Get the fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + * + * @return the managedBy value + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Set the fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + * + * @param managedBy the managedBy value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; + } + + /** + * Get metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + * + * @param kind the kind value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the identity value. + * + * @return the identity value + */ + public ResourceModelWithAllowedPropertySetIdentity identity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public ResourceModelWithAllowedPropertySetSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withSku(ResourceModelWithAllowedPropertySetSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the plan value. + * + * @return the plan value + */ + public ResourceModelWithAllowedPropertySetPlan plan() { + return this.plan; + } + + /** + * Set the plan value. + * + * @param plan the plan value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + this.plan = plan; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetIdentity.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetIdentity.java new file mode 100644 index 0000000000000..5b30a6e5d26c0 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetIdentity.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The ResourceModelWithAllowedPropertySetIdentity model. + */ +public class ResourceModelWithAllowedPropertySetIdentity extends Identity { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetPlan.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetPlan.java new file mode 100644 index 0000000000000..e4936379b9bc4 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetPlan.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The ResourceModelWithAllowedPropertySetPlan model. + */ +public class ResourceModelWithAllowedPropertySetPlan extends Plan { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetSku.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetSku.java new file mode 100644 index 0000000000000..849de36614b04 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetSku.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The ResourceModelWithAllowedPropertySetSku model. + */ +public class ResourceModelWithAllowedPropertySetSku extends Sku { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Sku.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Sku.java new file mode 100644 index 0000000000000..fc927a4e3d86b --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Sku.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource model definition representing SKU. + */ +public class Sku { + /** + * The name of the SKU. Ex - P3. It is typically a letter+number code. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * This field is required to be implemented by the Resource Provider if the + * service has more than one tier, but is not required on a PUT. Possible + * values include: 'Free', 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * The SKU size. When the name field is the combination of tier and some + * other value, this would be the standalone code. + */ + @JsonProperty(value = "size") + private String size; + + /** + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /** + * If the SKU supports scale out/in then the capacity integer should be + * included. If scale out/in is not possible for the resource this may be + * omitted. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get this field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set this field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get if the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set if the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get if the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set if the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/SkuTier.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/SkuTier.java new file mode 100644 index 0000000000000..24dc908c381e5 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/SkuTier.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuTier. + */ +public enum SkuTier { + /** Enum value Free. */ + FREE("Free"), + + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusLevelTypes.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusLevelTypes.java new file mode 100644 index 0000000000000..ea63eea1e8de7 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusLevelTypes.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StatusLevelTypes. + */ +public final class StatusLevelTypes extends ExpandableStringEnum { + /** Static value Info for StatusLevelTypes. */ + public static final StatusLevelTypes INFO = fromString("Info"); + + /** Static value Warning for StatusLevelTypes. */ + public static final StatusLevelTypes WARNING = fromString("Warning"); + + /** Static value Error for StatusLevelTypes. */ + public static final StatusLevelTypes ERROR = fromString("Error"); + + /** + * Creates or finds a StatusLevelTypes from its string representation. + * @param name a name to look for + * @return the corresponding StatusLevelTypes + */ + @JsonCreator + public static StatusLevelTypes fromString(String name) { + return fromString(name, StatusLevelTypes.class); + } + + /** + * @return known StatusLevelTypes values + */ + public static Collection values() { + return values(StatusLevelTypes.class); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusTypes.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusTypes.java new file mode 100644 index 0000000000000..d9bad79b09e2c --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusTypes.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StatusTypes. + */ +public final class StatusTypes extends ExpandableStringEnum { + /** Static value Connected for StatusTypes. */ + public static final StatusTypes CONNECTED = fromString("Connected"); + + /** Static value Disconnected for StatusTypes. */ + public static final StatusTypes DISCONNECTED = fromString("Disconnected"); + + /** Static value Error for StatusTypes. */ + public static final StatusTypes ERROR = fromString("Error"); + + /** + * Creates or finds a StatusTypes from its string representation. + * @param name a name to look for + * @return the corresponding StatusTypes + */ + @JsonCreator + public static StatusTypes fromString(String name) { + return fromString(name, StatusTypes.class); + } + + /** + * @return known StatusTypes values + */ + public static Collection values() { + return values(StatusTypes.class); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/UpdateResource.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/UpdateResource.java new file mode 100644 index 0000000000000..a5ea4461fcf49 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/UpdateResource.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Update Resource model definition. + */ +public class UpdateResource { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the UpdateResource object itself. + */ + public UpdateResource withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManagementClientImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManagementClientImpl.java new file mode 100644 index 0000000000000..ad088802f6c1a --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the HybridComputeManagementClientImpl class. + */ +public class HybridComputeManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HybridComputeManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HybridComputeManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public HybridComputeManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public HybridComputeManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The MachinesInner object to access its operations. + */ + private MachinesInner machines; + + /** + * Gets the MachinesInner object to access its operations. + * @return the MachinesInner object. + */ + public MachinesInner machines() { + return this.machines; + } + + /** + * The MachineExtensionsInner object to access its operations. + */ + private MachineExtensionsInner machineExtensions; + + /** + * Gets the MachineExtensionsInner object to access its operations. + * @return the MachineExtensionsInner object. + */ + public MachineExtensionsInner machineExtensions() { + return this.machineExtensions; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of HybridComputeManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HybridComputeManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HybridComputeManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HybridComputeManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HybridComputeManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HybridComputeManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-12-12"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.machines = new MachinesInner(restClient().retrofit(), this); + this.machineExtensions = new MachineExtensionsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "HybridComputeManagementClient", "2019-12-12"); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManager.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManager.java new file mode 100644 index 0000000000000..79dd4a05fee5f --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManager.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure HybridCompute resource management. + */ +public final class HybridComputeManager extends ManagerCore { + private Machines machines; + private MachineExtensions machineExtensions; + private Operations operations; + /** + * Get a Configurable instance that can be used to create HybridComputeManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new HybridComputeManager.ConfigurableImpl(); + } + /** + * Creates an instance of HybridComputeManager that exposes HybridCompute resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the HybridComputeManager + */ + public static HybridComputeManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new HybridComputeManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of HybridComputeManager that exposes HybridCompute resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the HybridComputeManager + */ + public static HybridComputeManager authenticate(RestClient restClient, String subscriptionId) { + return new HybridComputeManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of HybridComputeManager that exposes HybridCompute management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing HybridCompute management API entry points that work across subscriptions + */ + HybridComputeManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Machines. + */ + public Machines machines() { + if (this.machines == null) { + this.machines = new MachinesImpl(this); + } + return this.machines; + } + + /** + * @return Entry point to manage MachineExtensions. + */ + public MachineExtensions machineExtensions() { + if (this.machineExtensions == null) { + this.machineExtensions = new MachineExtensionsImpl(this); + } + return this.machineExtensions; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public HybridComputeManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return HybridComputeManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private HybridComputeManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new HybridComputeManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/IdParsingUtils.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..07c115c43e549 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionImpl.java new file mode 100644 index 0000000000000..3311c1d22be98 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionImpl.java @@ -0,0 +1,267 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtension; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionUpdate; +import java.util.Map; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionPropertiesInstanceView; +import rx.functions.Func1; + +class MachineExtensionImpl extends CreatableUpdatableImpl implements MachineExtension, MachineExtension.Definition, MachineExtension.Update { + private final HybridComputeManager manager; + private String resourceGroupName; + private String name; + private String extensionName; + private MachineExtensionUpdate updateParameter; + + MachineExtensionImpl(String name, HybridComputeManager manager) { + super(name, new MachineExtensionInner()); + this.manager = manager; + // Set resource name + this.extensionName = name; + // + this.updateParameter = new MachineExtensionUpdate(); + } + + MachineExtensionImpl(MachineExtensionInner inner, HybridComputeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.extensionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "machines"); + this.extensionName = IdParsingUtils.getValueFromIdByName(inner.id(), "extensions"); + // + this.updateParameter = new MachineExtensionUpdate(); + } + + @Override + public HybridComputeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + MachineExtensionsInner client = this.manager().inner().machineExtensions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.name, this.extensionName, this.inner()) + .map(new Func1() { + @Override + public MachineExtensionInner call(MachineExtensionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MachineExtensionsInner client = this.manager().inner().machineExtensions(); + return client.updateAsync(this.resourceGroupName, this.name, this.extensionName, this.updateParameter) + .map(new Func1() { + @Override + public MachineExtensionInner call(MachineExtensionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MachineExtensionsInner client = this.manager().inner().machineExtensions(); + return client.getAsync(this.resourceGroupName, this.name, this.extensionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new MachineExtensionUpdate(); + } + + @Override + public Boolean autoUpgradeMinorVersion() { + return this.inner().autoUpgradeMinorVersion(); + } + + @Override + public String forceUpdateTag() { + return this.inner().forceUpdateTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public MachineExtensionPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String machineExtensionType() { + return this.inner().machineExtensionType(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object protectedSettings() { + return this.inner().protectedSettings(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String publisher() { + return this.inner().publisher(); + } + + @Override + public Object settings() { + return this.inner().settings(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String typeHandlerVersion() { + return this.inner().typeHandlerVersion(); + } + + @Override + public MachineExtensionImpl withExistingMachine(String resourceGroupName, String name) { + this.resourceGroupName = resourceGroupName; + this.name = name; + return this; + } + + @Override + public MachineExtensionImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public MachineExtensionImpl withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { + this.inner().withInstanceView(instanceView); + return this; + } + + @Override + public MachineExtensionImpl withMachineExtensionType(String machineExtensionType) { + this.inner().withMachineExtensionType(machineExtensionType); + return this; + } + + @Override + public MachineExtensionImpl withType(String type) { + this.updateParameter.withType(type); + return this; + } + + @Override + public MachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.inner().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } else { + this.updateParameter.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } + return this; + } + + @Override + public MachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.inner().withForceUpdateTag(forceUpdateTag); + } else { + this.updateParameter.withForceUpdateTag(forceUpdateTag); + } + return this; + } + + @Override + public MachineExtensionImpl withProtectedSettings(Object protectedSettings) { + if (isInCreateMode()) { + this.inner().withProtectedSettings(protectedSettings); + } else { + this.updateParameter.withProtectedSettings(protectedSettings); + } + return this; + } + + @Override + public MachineExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.inner().withPublisher(publisher); + } else { + this.updateParameter.withPublisher(publisher); + } + return this; + } + + @Override + public MachineExtensionImpl withSettings(Object settings) { + if (isInCreateMode()) { + this.inner().withSettings(settings); + } else { + this.updateParameter.withSettings(settings); + } + return this; + } + + @Override + public MachineExtensionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public MachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.inner().withTypeHandlerVersion(typeHandlerVersion); + } else { + this.updateParameter.withTypeHandlerVersion(typeHandlerVersion); + } + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionInner.java new file mode 100644 index 0000000000000..4744319e168d4 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionInner.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Describes a Machine Extension. + */ +@JsonFlatten +public class MachineExtensionInner extends Resource { + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String machineExtensionType; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The machine extension instance view. + */ + @JsonProperty(value = "properties.instanceView") + private MachineExtensionPropertiesInstanceView instanceView; + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the machineExtensionType value + */ + public String machineExtensionType() { + return this.machineExtensionType; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param machineExtensionType the machineExtensionType value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withMachineExtensionType(String machineExtensionType) { + this.machineExtensionType = machineExtensionType; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the machine extension instance view. + * + * @return the instanceView value + */ + public MachineExtensionPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Set the machine extension instance view. + * + * @param instanceView the instanceView value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsImpl.java new file mode 100644 index 0000000000000..c6850c20f3341 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtension; + +class MachineExtensionsImpl extends WrapperImpl implements MachineExtensions { + private final HybridComputeManager manager; + + MachineExtensionsImpl(HybridComputeManager manager) { + super(manager.inner().machineExtensions()); + this.manager = manager; + } + + public HybridComputeManager manager() { + return this.manager; + } + + @Override + public MachineExtensionImpl define(String name) { + return wrapModel(name); + } + + private MachineExtensionImpl wrapModel(MachineExtensionInner inner) { + return new MachineExtensionImpl(inner, manager()); + } + + private MachineExtensionImpl wrapModel(String name) { + return new MachineExtensionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String name) { + MachineExtensionsInner client = this.inner(); + return client.listAsync(resourceGroupName, name) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MachineExtension call(MachineExtensionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String name, String extensionName) { + MachineExtensionsInner client = this.inner(); + return client.getAsync(resourceGroupName, name, extensionName) + .flatMap(new Func1>() { + @Override + public Observable call(MachineExtensionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((MachineExtension)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name, String extensionName) { + MachineExtensionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name, extensionName).toCompletable(); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsInner.java new file mode 100644 index 0000000000000..7e670515bf173 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsInner.java @@ -0,0 +1,1094 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MachineExtensions. + */ +public class MachineExtensionsInner { + /** The Retrofit service to perform REST calls. */ + private MachineExtensionsService service; + /** The service client containing this operation class. */ + private HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of MachineExtensionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MachineExtensionsInner(Retrofit retrofit, HybridComputeManagementClientImpl client) { + this.service = retrofit.create(MachineExtensionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for MachineExtensions to be + * used by Retrofit to perform actually REST calls. + */ + interface MachineExtensionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Body MachineExtensionInner extensionParameters, @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.hybridcompute.v2019_12_12.MachineExtensions beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Body MachineExtensionInner extensionParameters, @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.hybridcompute.v2019_12_12.MachineExtensions update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Body MachineExtensionUpdate extensionParameters, @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.hybridcompute.v2019_12_12.MachineExtensions beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Body MachineExtensionUpdate extensionParameters, @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.hybridcompute.v2019_12_12.MachineExtensions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("$expand") String expand, @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.hybridcompute.v2019_12_12.MachineExtensions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner createOrUpdate(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).toBlocking().last().body(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(extensionParameters); + Observable> observable = service.createOrUpdate(resourceGroupName, name, extensionName, this.client.subscriptionId(), extensionParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner beginCreateOrUpdate(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).toBlocking().single().body(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(extensionParameters); + return service.beginCreateOrUpdate(resourceGroupName, name, extensionName, this.client.subscriptionId(), extensionParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(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); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner update(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).toBlocking().last().body(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(extensionParameters); + Observable> observable = service.update(resourceGroupName, name, extensionName, this.client.subscriptionId(), extensionParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner beginUpdate(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).toBlocking().single().body(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(extensionParameters); + return service.beginUpdate(resourceGroupName, name, extensionName, this.client.subscriptionId(), extensionParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(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); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String name, String extensionName) { + deleteWithServiceResponseAsync(resourceGroupName, name, extensionName).toBlocking().last().body(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @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 deleteAsync(String resourceGroupName, String name, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name, extensionName), serviceCallback); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String name, String extensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, name, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name, String extensionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, name, extensionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String name, String extensionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, name, extensionName).toBlocking().single().body(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @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 beginDeleteAsync(String resourceGroupName, String name, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, name, extensionName), serviceCallback); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String name, String extensionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, name, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String name, String extensionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, name, extensionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(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); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @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 MachineExtensionInner object if successful. + */ + public MachineExtensionInner get(String resourceGroupName, String name, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, name, extensionName).toBlocking().single().body(); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @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 getAsync(String resourceGroupName, String name, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, name, extensionName), serviceCallback); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String name, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, name, extensionName).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String name, String extensionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, name, extensionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(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); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MachineExtensionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String name) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, name).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @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> listAsync(final String resourceGroupName, final String name, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, name), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String name) { + return listWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String name) { + return listSinglePageAsync(resourceGroupName, name) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineExtensionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.list(resourceGroupName, name, this.client.subscriptionId(), expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MachineExtensionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String name, final String expand) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, name, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String name, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, name, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String name, final String expand) { + return listWithServiceResponseAsync(resourceGroupName, name, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String name, final String expand) { + return listSinglePageAsync(resourceGroupName, name, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param name The name of the machine containing the extension. + ServiceResponse> * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineExtensionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String name, final String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, name, this.client.subscriptionId(), expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(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); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MachineExtensionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineExtensionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(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); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineImpl.java new file mode 100644 index 0000000000000..215b933dc483e --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineImpl.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Machine; +import rx.Observable; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineUpdate; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.LocationData; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachinePropertiesOsProfile; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.StatusTypes; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.ErrorDetail; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionInstanceView; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineIdentity; +import rx.functions.Func1; + +class MachineImpl extends GroupableResourceCoreImpl implements Machine, Machine.Definition, Machine.Update { + private MachineUpdate updateParameter; + MachineImpl(String name, MachineInner inner, HybridComputeManager manager) { + super(name, inner, manager); + this.updateParameter = new MachineUpdate(); + } + + @Override + public Observable createResourceAsync() { + MachinesInner client = this.manager().inner().machines(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public MachineInner call(MachineInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MachinesInner client = this.manager().inner().machines(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public MachineInner call(MachineInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MachinesInner client = this.manager().inner().machines(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new MachineUpdate(); + } + + @Override + public String agentVersion() { + return this.inner().agentVersion(); + } + + @Override + public String clientPublicKey() { + return this.inner().clientPublicKey(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public List errorDetails() { + return this.inner().errorDetails(); + } + + @Override + public List extensions() { + return this.inner().extensions(); + } + + @Override + public MachineIdentity identity() { + return this.inner().identity(); + } + + @Override + public DateTime lastStatusChange() { + return this.inner().lastStatusChange(); + } + + @Override + public LocationData locationData() { + return this.inner().locationData(); + } + + @Override + public String machineFqdn() { + return this.inner().machineFqdn(); + } + + @Override + public String osName() { + return this.inner().osName(); + } + + @Override + public MachinePropertiesOsProfile osProfile() { + return this.inner().osProfile(); + } + + @Override + public String osVersion() { + return this.inner().osVersion(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public StatusTypes status() { + return this.inner().status(); + } + + @Override + public String vmId() { + return this.inner().vmId(); + } + + @Override + public MachineImpl withClientPublicKey(String clientPublicKey) { + this.inner().withClientPublicKey(clientPublicKey); + return this; + } + + @Override + public MachineImpl withExtensions(List extensions) { + this.inner().withExtensions(extensions); + return this; + } + + @Override + public MachineImpl withIdentity(MachineIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public MachineImpl withOsProfile(MachinePropertiesOsProfile osProfile) { + this.inner().withOsProfile(osProfile); + return this; + } + + @Override + public MachineImpl withVmId(String vmId) { + this.inner().withVmId(vmId); + return this; + } + + @Override + public MachineImpl withLocationData(LocationData locationData) { + if (isInCreateMode()) { + this.inner().withLocationData(locationData); + } else { + this.updateParameter.withLocationData(locationData); + } + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineInner.java new file mode 100644 index 0000000000000..87eb4c6ca3a9f --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineInner.java @@ -0,0 +1,321 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.management.hybridcompute.v2019_12_12.LocationData; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachinePropertiesOsProfile; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.StatusTypes; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.ErrorDetail; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionInstanceView; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Describes a hybrid machine. + */ +@JsonFlatten +public class MachineInner extends Resource { + /** + * The locationData property. + */ + @JsonProperty(value = "properties.locationData") + private LocationData locationData; + + /** + * Specifies the operating system settings for the hybrid machine. + */ + @JsonProperty(value = "properties.osProfile") + private MachinePropertiesOsProfile osProfile; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The status of the hybrid machine agent. Possible values include: + * 'Connected', 'Disconnected', 'Error'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private StatusTypes status; + + /** + * The time of the last status change. + */ + @JsonProperty(value = "properties.lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastStatusChange; + + /** + * Details about the error state. + */ + @JsonProperty(value = "properties.errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /** + * The hybrid machine agent full version. + */ + @JsonProperty(value = "properties.agentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String agentVersion; + + /** + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "properties.vmId") + private String vmId; + + /** + * Specifies the hybrid machine display name. + */ + @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Specifies the hybrid machine FQDN. + */ + @JsonProperty(value = "properties.machineFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String machineFqdn; + + /** + * Public Key that the client provides to be used during initial resource + * onboarding. + */ + @JsonProperty(value = "properties.clientPublicKey") + private String clientPublicKey; + + /** + * The Operating System running on the hybrid machine. + */ + @JsonProperty(value = "properties.osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /** + * The version of Operating System running on the hybrid machine. + */ + @JsonProperty(value = "properties.osVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osVersion; + + /** + * Machine Extensions information. + */ + @JsonProperty(value = "properties.extensions") + private List extensions; + + /** + * The identity property. + */ + @JsonProperty(value = "identity") + private MachineIdentity identity; + + /** + * Get the locationData value. + * + * @return the locationData value + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData value. + * + * @param locationData the locationData value to set + * @return the MachineInner object itself. + */ + public MachineInner withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + + /** + * Get specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value + */ + public MachinePropertiesOsProfile osProfile() { + return this.osProfile; + } + + /** + * Set specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set + * @return the MachineInner object itself. + */ + public MachineInner withOsProfile(MachinePropertiesOsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the hybrid machine agent. Possible values include: 'Connected', 'Disconnected', 'Error'. + * + * @return the status value + */ + public StatusTypes status() { + return this.status; + } + + /** + * Get the time of the last status change. + * + * @return the lastStatusChange value + */ + public DateTime lastStatusChange() { + return this.lastStatusChange; + } + + /** + * Get details about the error state. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the hybrid machine agent full version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Get specifies the hybrid machine unique ID. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Set specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set + * @return the MachineInner object itself. + */ + public MachineInner withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get specifies the hybrid machine display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get specifies the hybrid machine FQDN. + * + * @return the machineFqdn value + */ + public String machineFqdn() { + return this.machineFqdn; + } + + /** + * Get public Key that the client provides to be used during initial resource onboarding. + * + * @return the clientPublicKey value + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set public Key that the client provides to be used during initial resource onboarding. + * + * @param clientPublicKey the clientPublicKey value to set + * @return the MachineInner object itself. + */ + public MachineInner withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + + /** + * Get the Operating System running on the hybrid machine. + * + * @return the osName value + */ + public String osName() { + return this.osName; + } + + /** + * Get the version of Operating System running on the hybrid machine. + * + * @return the osVersion value + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Get machine Extensions information. + * + * @return the extensions value + */ + public List extensions() { + return this.extensions; + } + + /** + * Set machine Extensions information. + * + * @param extensions the extensions value to set + * @return the MachineInner object itself. + */ + public MachineInner withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the identity value. + * + * @return the identity value + */ + public MachineIdentity identity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + * @return the MachineInner object itself. + */ + public MachineInner withIdentity(MachineIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesImpl.java new file mode 100644 index 0000000000000..55886f8f42a33 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Machine; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineReconnect; + +class MachinesImpl extends GroupableResourcesCoreImpl implements Machines { + protected MachinesImpl(HybridComputeManager manager) { + super(manager.inner().machines(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + MachinesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + MachinesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + MachinesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + MachinesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Machine call(MachineInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + MachinesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + MachinesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Machine call(MachineInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public MachineImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable reconnectAsync(String resourceGroupName, String name, MachineReconnect parameters) { + MachinesInner client = this.inner(); + return client.reconnectAsync(resourceGroupName, name, parameters) + .map(new Func1() { + @Override + public Machine call(MachineInner inner) { + return new MachineImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected MachineImpl wrapModel(MachineInner inner) { + return new MachineImpl(inner.name(), inner, manager()); + } + + @Override + protected MachineImpl wrapModel(String name) { + return new MachineImpl(name, new MachineInner(), this.manager()); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesInner.java new file mode 100644 index 0000000000000..50c20c34d9480 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesInner.java @@ -0,0 +1,1092 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.ErrorResponseException; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.InstanceViewTypes; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineReconnect; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Machines. + */ +public class MachinesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private MachinesService service; + /** The service client containing this operation class. */ + private HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of MachinesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MachinesInner(Retrofit retrofit, HybridComputeManagementClientImpl client) { + this.service = retrofit.create(MachinesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Machines to be + * used by Retrofit to perform actually REST calls. + */ + interface MachinesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body MachineInner parameters, @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.hybridcompute.v2019_12_12.Machines update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body MachineUpdate parameters, @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.hybridcompute.v2019_12_12.Machines delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.hybridcompute.v2019_12_12.Machines getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Query("$expand") InstanceViewTypes expand, @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.hybridcompute.v2019_12_12.Machines reconnect" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/reconnect") + Observable> reconnect(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body MachineReconnect parameters, @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.hybridcompute.v2019_12_12.Machines listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.hybridcompute.v2019_12_12.Machines list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * The operation to create or update a hybrid machine resource identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Create hybrid machine operation. + * @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 MachineInner object if successful. + */ + public MachineInner createOrUpdate(String resourceGroupName, String name, MachineInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * The operation to create or update a hybrid machine resource identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Create hybrid machine operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String name, MachineInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * The operation to create or update a hybrid machine resource identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Create hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String name, MachineInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update a hybrid machine resource identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Create hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, MachineInner parameters) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to update a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Update hybrid machine operation. + * @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 MachineInner object if successful. + */ + public MachineInner update(String resourceGroupName, String name, MachineUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * The operation to update a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Update hybrid machine operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String name, MachineUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * The operation to update a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Update hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable updateAsync(String resourceGroupName, String name, MachineUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Update hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, MachineUpdate parameters) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to remove a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @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 + */ + public void delete(String resourceGroupName, String name) { + deleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * The operation to remove a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @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 deleteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * The operation to remove a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String name) { + return deleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to remove a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @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 MachineInner object if successful. + */ + public MachineInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @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 getByResourceGroupAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String name) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final InstanceViewTypes expand = null; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @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 MachineInner object if successful. + */ + public MachineInner getByResourceGroup(String resourceGroupName, String name, InstanceViewTypes expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name, expand).toBlocking().single().body(); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @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 getByResourceGroupAsync(String resourceGroupName, String name, InstanceViewTypes expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, name, expand), serviceCallback); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String name, InstanceViewTypes expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name, expand).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String name, InstanceViewTypes expand) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @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 MachineInner object if successful. + */ + public MachineInner reconnect(String resourceGroupName, String name, MachineReconnect parameters) { + return reconnectWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reconnectAsync(String resourceGroupName, String name, MachineReconnect parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reconnectWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable reconnectAsync(String resourceGroupName, String name, MachineReconnect parameters) { + return reconnectWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> reconnectWithServiceResponseAsync(String resourceGroupName, String name, MachineReconnect parameters) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.reconnect(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reconnectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reconnectDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param resourceGroupName The name of the resource group. + * @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 PagedList<MachineInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param resourceGroupName The name of the resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @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 PagedList<MachineInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<MachineInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<MachineInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueImpl.java new file mode 100644 index 0000000000000..c226442d6b411 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.management.hybridcompute.v2019_12_12.OperationValue; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class OperationValueImpl extends WrapperImpl implements OperationValue { + private final HybridComputeManager manager; + OperationValueImpl(OperationValueInner inner, HybridComputeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HybridComputeManager manager() { + return this.manager; + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public String provider() { + return this.inner().provider(); + } + + @Override + public String resource() { + return this.inner().resource(); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueInner.java new file mode 100644 index 0000000000000..232cf5adbfda0 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueInner.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes the properties of a Compute Operation value. + */ +@JsonFlatten +public class OperationValueInner { + /** + * The origin of the compute operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * The name of the compute operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display name of the compute operation. + */ + @JsonProperty(value = "display.operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "display.resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The description of the operation. + */ + @JsonProperty(value = "display.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The resource provider for the operation. + */ + @JsonProperty(value = "display.provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Get the origin of the compute operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get the name of the compute operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display name of the compute operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the display name of the resource the operation applies to. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the resource provider for the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..bbbc10d4ef462 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.OperationValue; + +class OperationsImpl extends WrapperImpl implements Operations { + private final HybridComputeManager manager; + + OperationsImpl(HybridComputeManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public HybridComputeManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public OperationValue call(OperationValueInner inner) { + return new OperationValueImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsInner.java new file mode 100644 index 0000000000000..7a97e47d13c8d --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsInner.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, HybridComputeManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Operations list" }) + @GET("providers/Microsoft.HybridCompute/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of hybrid compute operations. + * + * @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 List<OperationValueInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets a list of hybrid compute operations. + * + * @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> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets a list of hybrid compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationValueInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of hybrid compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationValueInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(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> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl.java new file mode 100644 index 0000000000000..391d95e38dd18 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl1.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl1.java new file mode 100644 index 0000000000000..dda24f62e1253 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/package-info.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/package-info.java new file mode 100644 index 0000000000000..82fb087df13cc --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for HybridComputeManagementClient. + * The Hybrid Compute Management Client. + */ +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/package-info.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/package-info.java new file mode 100644 index 0000000000000..3dffef4487077 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for HybridComputeManagementClient. + * The Hybrid Compute Management Client. + */ +package com.microsoft.azure.management.hybridcompute.v2019_12_12; diff --git a/sdk/hybridcompute/pom.mgmt.xml b/sdk/hybridcompute/pom.mgmt.xml new file mode 100644 index 0000000000000..5628c46ac670d --- /dev/null +++ b/sdk/hybridcompute/pom.mgmt.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-hybridcompute-management + pom + 1.0.0 + + mgmt-v2019_12_12 + +