diff --git a/api-specs.json b/api-specs.json index 3972a66ecf4b..3e05a0b02471 100644 --- a/api-specs.json +++ b/api-specs.json @@ -42,6 +42,10 @@ "source": "specification/containerregistry/resource-manager/readme.md", "args": "--multiapi=true --fluent=true" }, + "cosmosdb/resource-manager": { + "source": "specification/cosmos-db/resource-manager/readme.md", + "args": "--multiapi=true --fluent=true" + }, "datalakeanalytics/resource-manager": { "source": "specification/datalake-analytics/resource-manager/readme.md", "args": "--multiapi --fluent" diff --git a/cosmosdb/resource-manager/v2015_04_08/pom.xml b/cosmosdb/resource-manager/v2015_04_08/pom.xml index 7080a7e445cf..03fa4a662c43 100644 --- a/cosmosdb/resource-manager/v2015_04_08/pom.xml +++ b/cosmosdb/resource-manager/v2015_04_08/pom.xml @@ -11,15 +11,15 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-cosmosdb 1.0.0-beta jar - Microsoft Azure SDK for DocumentDB Management - This package contains Microsoft DocumentDB Management SDK. - https://github.com/Azure/azure-libraries-for-java + Microsoft Azure SDK for CosmosDB Management + This package contains Microsoft CosmosDB Management SDK. + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspace.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspace.java new file mode 100644 index 000000000000..c67f335d7cbd --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspace.java @@ -0,0 +1,127 @@ +/** + * 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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CassandraKeyspaceInner; +import com.microsoft.azure.arm.model.Indexable; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing CassandraKeyspace. + */ +public interface CassandraKeyspace extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the cassandraKeyspaceId value. + */ + String cassandraKeyspaceId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CassandraKeyspace definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApi, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of CassandraKeyspace definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CassandraKeyspace definition. + */ + interface Blank extends WithApi { + } + + /** + * The stage of the cassandrakeyspace definition allowing to specify Api. + */ + interface WithApi { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithOptions withExistingApi(String resourceGroupName, String accountName); + } + + /** + * The stage of the cassandrakeyspace definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the cassandrakeyspace definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a Cassandra keyspace + * @return the next definition stage + */ + WithCreate withResource(CassandraKeyspaceResource resource); + } + + /** + * 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 { + } + } + /** + * The template for a CassandraKeyspace update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of CassandraKeyspace update stages. + */ + interface UpdateStages { + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceCreateUpdateParameters.java new file mode 100644 index 000000000000..87d4ef3232ac --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Cassandra keyspace. + */ +@JsonFlatten +public class CassandraKeyspaceCreateUpdateParameters { + /** + * The standard JSON format of a Cassandra keyspace. + */ + @JsonProperty(value = "properties.resource", required = true) + private CassandraKeyspaceResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Cassandra keyspace. + * + * @return the resource value + */ + public CassandraKeyspaceResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Cassandra keyspace. + * + * @param resource the resource value to set + * @return the CassandraKeyspaceCreateUpdateParameters object itself. + */ + public CassandraKeyspaceCreateUpdateParameters withResource(CassandraKeyspaceResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the CassandraKeyspaceCreateUpdateParameters object itself. + */ + public CassandraKeyspaceCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceResource.java new file mode 100644 index 000000000000..17c4fb05b8d6 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra keyspace id object. + */ +public class CassandraKeyspaceResource { + /** + * Name of the Cosmos DB Cassandra keyspace. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB Cassandra keyspace. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB Cassandra keyspace. + * + * @param id the id value to set + * @return the CassandraKeyspaceResource object itself. + */ + public CassandraKeyspaceResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraPartitionKey.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraPartitionKey.java new file mode 100644 index 000000000000..bbe8939950a0 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraPartitionKey.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table partition key. + */ +public class CassandraPartitionKey { + /** + * Name of the Cosmos DB Cassandra table partition key. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get name of the Cosmos DB Cassandra table partition key. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Cosmos DB Cassandra table partition key. + * + * @param name the name value to set + * @return the CassandraPartitionKey object itself. + */ + public CassandraPartitionKey withName(String name) { + this.name = name; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraSchema.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraSchema.java new file mode 100644 index 000000000000..1570f18858c5 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraSchema.java @@ -0,0 +1,96 @@ +/** + * 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.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table schema. + */ +public class CassandraSchema { + /** + * List of Cassandra table columns. + */ + @JsonProperty(value = "columns") + private List columns; + + /** + * List of partition key. + */ + @JsonProperty(value = "partitionKeys") + private List partitionKeys; + + /** + * List of cluster key. + */ + @JsonProperty(value = "clusterKeys") + private List clusterKeys; + + /** + * Get list of Cassandra table columns. + * + * @return the columns value + */ + public List columns() { + return this.columns; + } + + /** + * Set list of Cassandra table columns. + * + * @param columns the columns value to set + * @return the CassandraSchema object itself. + */ + public CassandraSchema withColumns(List columns) { + this.columns = columns; + return this; + } + + /** + * Get list of partition key. + * + * @return the partitionKeys value + */ + public List partitionKeys() { + return this.partitionKeys; + } + + /** + * Set list of partition key. + * + * @param partitionKeys the partitionKeys value to set + * @return the CassandraSchema object itself. + */ + public CassandraSchema withPartitionKeys(List partitionKeys) { + this.partitionKeys = partitionKeys; + return this; + } + + /** + * Get list of cluster key. + * + * @return the clusterKeys value + */ + public List clusterKeys() { + return this.clusterKeys; + } + + /** + * Set list of cluster key. + * + * @param clusterKeys the clusterKeys value to set + * @return the CassandraSchema object itself. + */ + public CassandraSchema withClusterKeys(List clusterKeys) { + this.clusterKeys = clusterKeys; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTable.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTable.java new file mode 100644 index 000000000000..7057423db00f --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTable.java @@ -0,0 +1,61 @@ +/** + * 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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CassandraTableInner; +import java.util.Map; + +/** + * Type representing CassandraTable. + */ +public interface CassandraTable extends HasInner, HasManager { + /** + * @return the cassandraTableId value. + */ + String cassandraTableId(); + + /** + * @return the defaultTtl value. + */ + Integer defaultTtl(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the schema value. + */ + CassandraSchema schema(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableCreateUpdateParameters.java new file mode 100644 index 000000000000..71433d405cfe --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Cassandra table. + */ +@JsonFlatten +public class CassandraTableCreateUpdateParameters { + /** + * The standard JSON format of a Cassandra table. + */ + @JsonProperty(value = "properties.resource", required = true) + private CassandraTableResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Cassandra table. + * + * @return the resource value + */ + public CassandraTableResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Cassandra table. + * + * @param resource the resource value to set + * @return the CassandraTableCreateUpdateParameters object itself. + */ + public CassandraTableCreateUpdateParameters withResource(CassandraTableResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the CassandraTableCreateUpdateParameters object itself. + */ + public CassandraTableCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableResource.java new file mode 100644 index 000000000000..6118e97f2b11 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableResource.java @@ -0,0 +1,95 @@ +/** + * 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.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table id object. + */ +public class CassandraTableResource { + /** + * Name of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Time to live of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "defaultTtl") + private Integer defaultTtl; + + /** + * Schema of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "schema") + private CassandraSchema schema; + + /** + * Get name of the Cosmos DB Cassandra table. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB Cassandra table. + * + * @param id the id value to set + * @return the CassandraTableResource object itself. + */ + public CassandraTableResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get time to live of the Cosmos DB Cassandra table. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set time to live of the Cosmos DB Cassandra table. + * + * @param defaultTtl the defaultTtl value to set + * @return the CassandraTableResource object itself. + */ + public CassandraTableResource withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get schema of the Cosmos DB Cassandra table. + * + * @return the schema value + */ + public CassandraSchema schema() { + return this.schema; + } + + /** + * Set schema of the Cosmos DB Cassandra table. + * + * @param schema the schema value to set + * @return the CassandraTableResource object itself. + */ + public CassandraTableResource withSchema(CassandraSchema schema) { + this.schema = schema; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ClusterKey.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ClusterKey.java new file mode 100644 index 000000000000..45ea38f0b852 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ClusterKey.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table cluster key. + */ +public class ClusterKey { + /** + * Name of the Cosmos DB Cassandra table cluster key. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Order of the Cosmos DB Cassandra table cluster key, only support "Asc" + * and "Desc". + */ + @JsonProperty(value = "orderBy") + private String orderBy; + + /** + * Get name of the Cosmos DB Cassandra table cluster key. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Cosmos DB Cassandra table cluster key. + * + * @param name the name value to set + * @return the ClusterKey object itself. + */ + public ClusterKey withName(String name) { + this.name = name; + return this; + } + + /** + * Get order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc". + * + * @return the orderBy value + */ + public String orderBy() { + return this.orderBy; + } + + /** + * Set order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc". + * + * @param orderBy the orderBy value to set + * @return the ClusterKey object itself. + */ + public ClusterKey withOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java index c66ba45a57a7..f81040613764 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java @@ -11,14 +11,14 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import org.joda.time.DateTime; import java.util.List; /** * Type representing CollectionDatabasisDatabaseAccountMetric. */ -public interface CollectionDatabasisDatabaseAccountMetric extends HasInner, HasManager { +public interface CollectionDatabasisDatabaseAccountMetric extends HasInner, HasManager { /** * @return the endTime value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java index 40fd314c0d95..5253f6b6fc18 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java @@ -11,13 +11,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricDefinitionInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import java.util.List; /** * Type representing CollectionDatabasisDatabaseAccountMetricDefinition. */ -public interface CollectionDatabasisDatabaseAccountMetricDefinition extends HasInner, HasManager { +public interface CollectionDatabasisDatabaseAccountMetricDefinition extends HasInner, HasManager { /** * @return the metricAvailabilities value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java index 4888a071fa38..627840565ec2 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java @@ -11,14 +11,14 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import org.joda.time.DateTime; import java.util.List; /** * Type representing CollectionDatabasisDatabaseAccountMetricModel. */ -public interface CollectionDatabasisDatabaseAccountMetricModel extends HasInner, HasManager { +public interface CollectionDatabasisDatabaseAccountMetricModel extends HasInner, HasManager { /** * @return the endTime value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java index 1591f221890f..1ad433e3a8cc 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java @@ -11,12 +11,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.UsageInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; /** * Type representing CollectionDatabasisDatabaseAccountUsage. */ -public interface CollectionDatabasisDatabaseAccountUsage extends HasInner, HasManager { +public interface CollectionDatabasisDatabaseAccountUsage extends HasInner, HasManager { /** * @return the currentValue value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Collections.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Collections.java index 64f0cdf744bc..308b198dedcd 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Collections.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Collections.java @@ -18,7 +18,7 @@ */ public interface Collections { /** - * Retrieves metric defintions for the given collection. + * Retrieves metric definitions for the given collection. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Column.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Column.java new file mode 100644 index 000000000000..66474dd6d67b --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Column.java @@ -0,0 +1,69 @@ +/** + * 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.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table column. + */ +public class Column { + /** + * Name of the Cosmos DB Cassandra table column. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Type of the Cosmos DB Cassandra table column. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get name of the Cosmos DB Cassandra table column. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Cosmos DB Cassandra table column. + * + * @param name the name value to set + * @return the Column object itself. + */ + public Column withName(String name) { + this.name = name; + return this; + } + + /** + * Get type of the Cosmos DB Cassandra table column. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the Cosmos DB Cassandra table column. + * + * @param type the type value to set + * @return the Column object itself. + */ + public Column withType(String type) { + this.type = type; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionMode.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionMode.java new file mode 100644 index 000000000000..f548581daa8b --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionMode.java @@ -0,0 +1,41 @@ +/** + * 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.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConflictResolutionMode. + */ +public final class ConflictResolutionMode extends ExpandableStringEnum { + /** Static value LastWriterWins for ConflictResolutionMode. */ + public static final ConflictResolutionMode LAST_WRITER_WINS = fromString("LastWriterWins"); + + /** Static value Custom for ConflictResolutionMode. */ + public static final ConflictResolutionMode CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ConflictResolutionMode from its string representation. + * @param name a name to look for + * @return the corresponding ConflictResolutionMode + */ + @JsonCreator + public static ConflictResolutionMode fromString(String name) { + return fromString(name, ConflictResolutionMode.class); + } + + /** + * @return known ConflictResolutionMode values + */ + public static Collection values() { + return values(ConflictResolutionMode.class); + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionPolicy.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionPolicy.java new file mode 100644 index 000000000000..e14e3d639f55 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionPolicy.java @@ -0,0 +1,96 @@ +/** + * 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.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The conflict resolution policy for the container. + */ +public class ConflictResolutionPolicy { + /** + * Indicates the conflict resolution mode. Possible values include: + * 'LastWriterWins', 'Custom'. + */ + @JsonProperty(value = "mode") + private ConflictResolutionMode mode; + + /** + * The conflict resolution path in the case of LastWriterWins mode. + */ + @JsonProperty(value = "conflictResolutionPath") + private String conflictResolutionPath; + + /** + * The procedure to resolve conflicts in the case of custom mode. + */ + @JsonProperty(value = "conflictResolutionProcedure") + private String conflictResolutionProcedure; + + /** + * Get indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom'. + * + * @return the mode value + */ + public ConflictResolutionMode mode() { + return this.mode; + } + + /** + * Set indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom'. + * + * @param mode the mode value to set + * @return the ConflictResolutionPolicy object itself. + */ + public ConflictResolutionPolicy withMode(ConflictResolutionMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the conflict resolution path in the case of LastWriterWins mode. + * + * @return the conflictResolutionPath value + */ + public String conflictResolutionPath() { + return this.conflictResolutionPath; + } + + /** + * Set the conflict resolution path in the case of LastWriterWins mode. + * + * @param conflictResolutionPath the conflictResolutionPath value to set + * @return the ConflictResolutionPolicy object itself. + */ + public ConflictResolutionPolicy withConflictResolutionPath(String conflictResolutionPath) { + this.conflictResolutionPath = conflictResolutionPath; + return this; + } + + /** + * Get the procedure to resolve conflicts in the case of custom mode. + * + * @return the conflictResolutionProcedure value + */ + public String conflictResolutionProcedure() { + return this.conflictResolutionProcedure; + } + + /** + * Set the procedure to resolve conflicts in the case of custom mode. + * + * @param conflictResolutionProcedure the conflictResolutionProcedure value to set + * @return the ConflictResolutionPolicy object itself. + */ + public ConflictResolutionPolicy withConflictResolutionProcedure(String conflictResolutionProcedure) { + this.conflictResolutionProcedure = conflictResolutionProcedure; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ContainerPartitionKey.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ContainerPartitionKey.java new file mode 100644 index 000000000000..25b9e1690116 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ContainerPartitionKey.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration of the partition key to be used for partitioning data into + * multiple partitions. + */ +public class ContainerPartitionKey { + /** + * List of paths using which data within the container can be partitioned. + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Indicates the kind of algorithm used for partitioning. Possible values + * include: 'Hash', 'Range'. + */ + @JsonProperty(value = "kind") + private PartitionKind kind; + + /** + * Get list of paths using which data within the container can be partitioned. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set list of paths using which data within the container can be partitioned. + * + * @param paths the paths value to set + * @return the ContainerPartitionKey object itself. + */ + public ContainerPartitionKey withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Get indicates the kind of algorithm used for partitioning. Possible values include: 'Hash', 'Range'. + * + * @return the kind value + */ + public PartitionKind kind() { + return this.kind; + } + + /** + * Set indicates the kind of algorithm used for partitioning. Possible values include: 'Hash', 'Range'. + * + * @param kind the kind value to set + * @return the ContainerPartitionKey object itself. + */ + public ContainerPartitionKey withKind(PartitionKind kind) { + this.kind = kind; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DataType.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DataType.java new file mode 100644 index 000000000000..6c05d35b1d14 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DataType.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataType. + */ +public final class DataType extends ExpandableStringEnum { + /** Static value String for DataType. */ + public static final DataType STRING = fromString("String"); + + /** Static value Number for DataType. */ + public static final DataType NUMBER = fromString("Number"); + + /** Static value Point for DataType. */ + public static final DataType POINT = fromString("Point"); + + /** Static value Polygon for DataType. */ + public static final DataType POLYGON = fromString("Polygon"); + + /** Static value LineString for DataType. */ + public static final DataType LINE_STRING = fromString("LineString"); + + /** Static value MultiPolygon for DataType. */ + public static final DataType MULTI_POLYGON = fromString("MultiPolygon"); + + /** + * Creates or finds a DataType from its string representation. + * @param name a name to look for + * @return the corresponding DataType + */ + @JsonCreator + public static DataType fromString(String name) { + return fromString(name, DataType.class); + } + + /** + * @return known DataType values + */ + public static Collection values() { + return values(DataType.class); + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccount.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccount.java index fc82aa718965..be9c08fbd3bb 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccount.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccount.java @@ -17,14 +17,14 @@ 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.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import java.util.List; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountInner; /** * Type representing DatabaseAccount. */ -public interface DatabaseAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { +public interface DatabaseAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { /** * @return the capabilities value. */ @@ -50,6 +50,11 @@ public interface DatabaseAccount extends HasInner, Resourc */ Boolean enableAutomaticFailover(); + /** + * @return the enableMultipleWriteLocations value. + */ + Boolean enableMultipleWriteLocations(); + /** * @return the failoverPolicies value. */ @@ -118,7 +123,9 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup locations); } /** - * The stage of the databaseaccount update allowing to specify Capabilities. + * The stage of the databaseaccount definition allowing to specify Capabilities. */ interface WithCapabilities { /** * Specifies capabilities. + * @param capabilities List of Cosmos DB capabilities for the account + * @return the next definition stage */ WithCreate withCapabilities(List capabilities); } /** - * The stage of the databaseaccount update allowing to specify ConsistencyPolicy. + * The stage of the databaseaccount definition allowing to specify ConsistencyPolicy. */ interface WithConsistencyPolicy { /** * Specifies consistencyPolicy. + * @param consistencyPolicy The consistency policy for the Cosmos DB account + * @return the next definition stage */ WithCreate withConsistencyPolicy(ConsistencyPolicy consistencyPolicy); } /** - * The stage of the databaseaccount update allowing to specify EnableAutomaticFailover. + * The stage of the databaseaccount definition allowing to specify EnableAutomaticFailover. */ interface WithEnableAutomaticFailover { /** * Specifies enableAutomaticFailover. + * @param enableAutomaticFailover Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account + * @return the next definition stage */ WithCreate withEnableAutomaticFailover(Boolean enableAutomaticFailover); } /** - * The stage of the databaseaccount update allowing to specify IpRangeFilter. + * The stage of the databaseaccount definition allowing to specify EnableMultipleWriteLocations. + */ + interface WithEnableMultipleWriteLocations { + /** + * Specifies enableMultipleWriteLocations. + * @param enableMultipleWriteLocations Enables the account to write in multiple locations + * @return the next definition stage + */ + WithCreate withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations); + } + + /** + * The stage of the databaseaccount definition allowing to specify IpRangeFilter. */ interface WithIpRangeFilter { /** * Specifies ipRangeFilter. + * @param ipRangeFilter Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces + * @return the next definition stage */ WithCreate withIpRangeFilter(String ipRangeFilter); } /** - * The stage of the databaseaccount update allowing to specify IsVirtualNetworkFilterEnabled. + * The stage of the databaseaccount definition allowing to specify IsVirtualNetworkFilterEnabled. */ interface WithIsVirtualNetworkFilterEnabled { /** * Specifies isVirtualNetworkFilterEnabled. + * @param isVirtualNetworkFilterEnabled Flag to indicate whether to enable/disable Virtual Network ACL rules + * @return the next definition stage */ WithCreate withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled); } /** - * The stage of the databaseaccount update allowing to specify Kind. + * The stage of the databaseaccount definition allowing to specify Kind. */ interface WithKind { /** * Specifies kind. + * @param kind Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' + * @return the next definition stage */ WithCreate withKind(DatabaseAccountKind kind); } /** - * The stage of the databaseaccount update allowing to specify VirtualNetworkRules. + * The stage of the databaseaccount definition allowing to specify VirtualNetworkRules. */ interface WithVirtualNetworkRules { /** * Specifies virtualNetworkRules. + * @param virtualNetworkRules List of Virtual Network ACL rules configured for the Cosmos DB account + * @return the next definition stage */ WithCreate withVirtualNetworkRules(List virtualNetworkRules); } @@ -207,7 +242,7 @@ 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.WithCapabilities, DefinitionStages.WithConsistencyPolicy, DefinitionStages.WithEnableAutomaticFailover, DefinitionStages.WithIpRangeFilter, DefinitionStages.WithIsVirtualNetworkFilterEnabled, DefinitionStages.WithKind, DefinitionStages.WithVirtualNetworkRules { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithCapabilities, DefinitionStages.WithConsistencyPolicy, DefinitionStages.WithEnableAutomaticFailover, DefinitionStages.WithEnableMultipleWriteLocations, DefinitionStages.WithIpRangeFilter, DefinitionStages.WithIsVirtualNetworkFilterEnabled, DefinitionStages.WithKind, DefinitionStages.WithVirtualNetworkRules { } } /** @@ -221,11 +256,13 @@ interface Update extends Appliable, Resource.UpdateWithTags capabilities); } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountCreateUpdateParameters.java index 0ec79c3e9d99..57403672cffa 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountCreateUpdateParameters.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountCreateUpdateParameters.java @@ -11,12 +11,14 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * Parameters to create and update Cosmos DB database accounts. */ @JsonFlatten +@SkipParentValidation public class DatabaseAccountCreateUpdateParameters extends Resource { /** * Indicates the type of database account. This can only be set at database @@ -40,7 +42,7 @@ public class DatabaseAccountCreateUpdateParameters extends Resource { private List locations; /** - * The databaseAccountOfferType property. + * The offer type for the database. */ @JsonProperty(value = "properties.databaseAccountOfferType", required = true) private String databaseAccountOfferType; @@ -81,6 +83,12 @@ public class DatabaseAccountCreateUpdateParameters extends Resource { @JsonProperty(value = "properties.virtualNetworkRules") private List virtualNetworkRules; + /** + * Enables the account to write in multiple locations. + */ + @JsonProperty(value = "properties.enableMultipleWriteLocations") + private Boolean enableMultipleWriteLocations; + /** * Creates an instance of DatabaseAccountCreateUpdateParameters class. * @param locations an array that contains the georeplication locations enabled for the Cosmos DB account. @@ -150,7 +158,7 @@ public DatabaseAccountCreateUpdateParameters withLocations(List locati } /** - * Get the databaseAccountOfferType value. + * Get the offer type for the database. * * @return the databaseAccountOfferType value */ @@ -159,7 +167,7 @@ public String databaseAccountOfferType() { } /** - * Set the databaseAccountOfferType value. + * Set the offer type for the database. * * @param databaseAccountOfferType the databaseAccountOfferType value to set * @return the DatabaseAccountCreateUpdateParameters object itself. @@ -269,4 +277,24 @@ public DatabaseAccountCreateUpdateParameters withVirtualNetworkRules(List, HasManager { +public interface DatabaseAccountListConnectionStringsResult extends HasInner, HasManager { /** * @return the connectionStrings value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListKeysResult.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListKeysResult.java index 08a891e07570..b0c705cad284 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListKeysResult.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListKeysResult.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountListKeysResultInner; /** * Type representing DatabaseAccountListKeysResult. */ -public interface DatabaseAccountListKeysResult extends HasInner, HasManager { +public interface DatabaseAccountListKeysResult extends HasInner, HasManager { /** * @return the primaryMasterKey value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java index 7494d9359013..613b002ed9ee 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountListReadOnlyKeysResultInner; /** * Type representing DatabaseAccountListReadOnlyKeysResult. */ -public interface DatabaseAccountListReadOnlyKeysResult extends HasInner, HasManager { +public interface DatabaseAccountListReadOnlyKeysResult extends HasInner, HasManager { /** * @return the primaryReadonlyMasterKey value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetric.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetric.java index 0b7368ff0045..e2b422e5cdc0 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetric.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetric.java @@ -11,14 +11,14 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import org.joda.time.DateTime; import java.util.List; /** * Type representing DatabaseAccountMetric. */ -public interface DatabaseAccountMetric extends HasInner, HasManager { +public interface DatabaseAccountMetric extends HasInner, HasManager { /** * @return the endTime value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetricDefinition.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetricDefinition.java index 706f921065be..c2256d7c4028 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetricDefinition.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetricDefinition.java @@ -11,13 +11,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricDefinitionInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import java.util.List; /** * Type representing DatabaseAccountMetricDefinition. */ -public interface DatabaseAccountMetricDefinition extends HasInner, HasManager { +public interface DatabaseAccountMetricDefinition extends HasInner, HasManager { /** * @return the metricAvailabilities value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountUsage.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountUsage.java index 370396418cfc..0b34841eb8cc 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountUsage.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountUsage.java @@ -11,12 +11,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.UsageInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; /** * Type representing DatabaseAccountUsage. */ -public interface DatabaseAccountUsage extends HasInner, HasManager { +public interface DatabaseAccountUsage extends HasInner, HasManager { /** * @return the currentValue value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccounts.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccounts.java index c8b29a04b91c..c167b0bbaace 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccounts.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccounts.java @@ -22,11 +22,56 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetric; import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountUsage; import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetricDefinition; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainer; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollection; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraph; /** * Type representing DatabaseAccounts. */ public interface DatabaseAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new Databasis resource. + * @param name resource name. + * @return the first stage of the new Databasis definition. + */ + SqlDatabase.DefinitionStages.Blank defineDatabasis(String name); + + /** + * Begins definition for a new Container resource. + * @param name resource name. + * @return the first stage of the new Container definition. + */ + SqlContainer.DefinitionStages.Blank defineContainer(String name); + + /** + * Begins definition for a new Collection resource. + * @param name resource name. + * @return the first stage of the new Collection definition. + */ + MongoDBCollection.DefinitionStages.Blank defineCollection(String name); + + /** + * Begins definition for a new Table resource. + * @param name resource name. + * @return the first stage of the new Table definition. + */ + Table.DefinitionStages.Blank defineTable(String name); + + /** + * Begins definition for a new Keyspace resource. + * @param name resource name. + * @return the first stage of the new Keyspace definition. + */ + CassandraKeyspace.DefinitionStages.Blank defineKeyspace(String name); + + /** + * Begins definition for a new Graph resource. + * @param name resource name. + * @return the first stage of the new Graph definition. + */ + GremlinGraph.DefinitionStages.Blank defineGraph(String name); + /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * @@ -118,7 +163,7 @@ public interface DatabaseAccounts extends SupportsCreating checkNameExistsAsync(String accountName); /** * Retrieves the metrics determined by the given filter for the given database account. @@ -142,7 +187,7 @@ public interface DatabaseAccounts extends SupportsCreating listUsagesAsync(String resourceGroupName, String accountName); /** - * Retrieves metric defintions for the given database account. + * Retrieves metric definitions for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. @@ -151,4 +196,341 @@ public interface DatabaseAccounts extends SupportsCreating listMetricDefinitionsAsync(String resourceGroupName, String accountName); + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSqlDatabasesAsync(String resourceGroupName, String accountName); + + /** + * Gets the SQL databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMongoDBDatabasesAsync(String resourceGroupName, String accountName); + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listGremlinDatabasesAsync(String resourceGroupName, String accountName); + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param 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 getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters); + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName); + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + Completable deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName); + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName); + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName); + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listTablesAsync(String resourceGroupName, String accountName); + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable
getTableAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + Completable deleteTableAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + Observable createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + Completable deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName); + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCassandraKeyspacesAsync(String resourceGroupName, String accountName); + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param 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 getCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + Completable deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName); + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + Completable deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName); + } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Databases.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Databases.java index 122c38b5d3fa..be27b8b60c0d 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Databases.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Databases.java @@ -18,7 +18,7 @@ */ public interface Databases { /** - * Retrieves metric defintions for the given database. + * Retrieves metric definitions for the given database. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetric.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetric.java index 9afba95e1fc0..ae60f081859b 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetric.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetric.java @@ -11,14 +11,14 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import org.joda.time.DateTime; import java.util.List; /** * Type representing DatabasisDatabaseAccountMetric. */ -public interface DatabasisDatabaseAccountMetric extends HasInner, HasManager { +public interface DatabasisDatabaseAccountMetric extends HasInner, HasManager { /** * @return the endTime value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java index afdc01b24010..402b93eaec63 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java @@ -11,13 +11,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricDefinitionInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import java.util.List; /** * Type representing DatabasisDatabaseAccountMetricDefinition. */ -public interface DatabasisDatabaseAccountMetricDefinition extends HasInner, HasManager { +public interface DatabasisDatabaseAccountMetricDefinition extends HasInner, HasManager { /** * @return the metricAvailabilities value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountUsage.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountUsage.java index 8c7681221664..c3e19ca660f1 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountUsage.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountUsage.java @@ -11,12 +11,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.UsageInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; /** * Type representing DatabasisDatabaseAccountUsage. */ -public interface DatabasisDatabaseAccountUsage extends HasInner, HasManager { +public interface DatabasisDatabaseAccountUsage extends HasInner, HasManager { /** * @return the currentValue value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExcludedPath.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExcludedPath.java new file mode 100644 index 000000000000..3885d4e55285 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExcludedPath.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ExcludedPath model. + */ +public class ExcludedPath { + /** + * The path for which the indexing behavior applies to. Index paths + * typically start with root and end with wildcard (/path/*). + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get the path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*). + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*). + * + * @param path the path value to set + * @return the ExcludedPath object itself. + */ + public ExcludedPath withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExtendedResourceProperties.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExtendedResourceProperties.java new file mode 100644 index 000000000000..184b855ded0d --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExtendedResourceProperties.java @@ -0,0 +1,98 @@ +/** + * 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.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The system generated resource properties associated with SQL databases and + * SQL containers. + */ +public class ExtendedResourceProperties { + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "_rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "_ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "_etag") + private String _etag; + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the ExtendedResourceProperties object itself. + */ + public ExtendedResourceProperties with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the ExtendedResourceProperties object itself. + */ + public ExtendedResourceProperties with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the ExtendedResourceProperties object itself. + */ + public ExtendedResourceProperties with_etag(String _etag) { + this._etag = _etag; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabase.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabase.java new file mode 100644 index 000000000000..b8c32d366393 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabase.java @@ -0,0 +1,66 @@ +/** + * 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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.GremlinDatabaseInner; +import java.util.Map; + +/** + * Type representing GremlinDatabase. + */ +public interface GremlinDatabase extends HasInner, HasManager { + /** + * @return the _etag value. + */ + String _etag(); + + /** + * @return the _rid value. + */ + String _rid(); + + /** + * @return the _ts value. + */ + Object _ts(); + + /** + * @return the gremlinDatabaseId value. + */ + String gremlinDatabaseId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseCreateUpdateParameters.java new file mode 100644 index 000000000000..1008c5811eb7 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Gremlin database. + */ +@JsonFlatten +public class GremlinDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a Gremlin database. + */ + @JsonProperty(value = "properties.resource", required = true) + private GremlinDatabaseResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Gremlin database. + * + * @return the resource value + */ + public GremlinDatabaseResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Gremlin database. + * + * @param resource the resource value to set + * @return the GremlinDatabaseCreateUpdateParameters object itself. + */ + public GremlinDatabaseCreateUpdateParameters withResource(GremlinDatabaseResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the GremlinDatabaseCreateUpdateParameters object itself. + */ + public GremlinDatabaseCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseResource.java new file mode 100644 index 000000000000..385493bf90b8 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Gremlin database id object. + */ +public class GremlinDatabaseResource { + /** + * Name of the Cosmos DB Gremlin database. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB Gremlin database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB Gremlin database. + * + * @param id the id value to set + * @return the GremlinDatabaseResource object itself. + */ + public GremlinDatabaseResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraph.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraph.java new file mode 100644 index 000000000000..e14a006984bc --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraph.java @@ -0,0 +1,169 @@ +/** + * 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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.GremlinGraphInner; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing GremlinGraph. + */ +public interface GremlinGraph extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the _etag value. + */ + String _etag(); + + /** + * @return the _rid value. + */ + String _rid(); + + /** + * @return the _ts value. + */ + Object _ts(); + + /** + * @return the conflictResolutionPolicy value. + */ + ConflictResolutionPolicy conflictResolutionPolicy(); + + /** + * @return the defaultTtl value. + */ + Integer defaultTtl(); + + /** + * @return the gremlinGraphId value. + */ + String gremlinGraphId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the indexingPolicy value. + */ + IndexingPolicy indexingPolicy(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partitionKey value. + */ + ContainerPartitionKey partitionKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueKeyPolicy value. + */ + UniqueKeyPolicy uniqueKeyPolicy(); + + /** + * The entirety of the GremlinGraph definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of GremlinGraph definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a GremlinGraph definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the gremlingraph definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, accountName, databaseName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @param databaseName Cosmos DB database name + * @return the next definition stage + */ + WithOptions withExistingDatabasis(String resourceGroupName, String accountName, String databaseName); + } + + /** + * The stage of the gremlingraph definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the gremlingraph definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a Gremlin graph + * @return the next definition stage + */ + WithCreate withResource(GremlinGraphResource resource); + } + + /** + * 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 { + } + } + /** + * The template for a GremlinGraph update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of GremlinGraph update stages. + */ + interface UpdateStages { + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphCreateUpdateParameters.java new file mode 100644 index 000000000000..f19390a320f1 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Gremlin graph. + */ +@JsonFlatten +public class GremlinGraphCreateUpdateParameters { + /** + * The standard JSON format of a Gremlin graph. + */ + @JsonProperty(value = "properties.resource", required = true) + private GremlinGraphResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Gremlin graph. + * + * @return the resource value + */ + public GremlinGraphResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Gremlin graph. + * + * @param resource the resource value to set + * @return the GremlinGraphCreateUpdateParameters object itself. + */ + public GremlinGraphCreateUpdateParameters withResource(GremlinGraphResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the GremlinGraphCreateUpdateParameters object itself. + */ + public GremlinGraphCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphResource.java new file mode 100644 index 000000000000..5684772e9353 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Gremlin graph resource object. + */ +public class GremlinGraphResource { + /** + * Name of the Cosmos DB Gremlin graph. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The configuration of the indexing policy. By default, the indexing is + * automatic for all document paths within the graph. + */ + @JsonProperty(value = "indexingPolicy") + private IndexingPolicy indexingPolicy; + + /** + * The configuration of the partition key to be used for partitioning data + * into multiple partitions. + */ + @JsonProperty(value = "partitionKey") + private ContainerPartitionKey partitionKey; + + /** + * Default time to live. + */ + @JsonProperty(value = "defaultTtl") + private Integer defaultTtl; + + /** + * The unique key policy configuration for specifying uniqueness + * constraints on documents in the collection in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "uniqueKeyPolicy") + private UniqueKeyPolicy uniqueKeyPolicy; + + /** + * The conflict resolution policy for the graph. + */ + @JsonProperty(value = "conflictResolutionPolicy") + private ConflictResolutionPolicy conflictResolutionPolicy; + + /** + * Get name of the Cosmos DB Gremlin graph. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB Gremlin graph. + * + * @param id the id value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph. + * + * @return the indexingPolicy value + */ + public IndexingPolicy indexingPolicy() { + return this.indexingPolicy; + } + + /** + * Set the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph. + * + * @param indexingPolicy the indexingPolicy value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withIndexingPolicy(IndexingPolicy indexingPolicy) { + this.indexingPolicy = indexingPolicy; + return this; + } + + /** + * Get the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @return the partitionKey value + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Set the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @param partitionKey the partitionKey value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withPartitionKey(ContainerPartitionKey partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get default time to live. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set default time to live. + * + * @param defaultTtl the defaultTtl value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeyPolicy value + */ + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.uniqueKeyPolicy; + } + + /** + * Set the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeyPolicy the uniqueKeyPolicy value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { + this.uniqueKeyPolicy = uniqueKeyPolicy; + return this; + } + + /** + * Get the conflict resolution policy for the graph. + * + * @return the conflictResolutionPolicy value + */ + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.conflictResolutionPolicy; + } + + /** + * Set the conflict resolution policy for the graph. + * + * @param conflictResolutionPolicy the conflictResolutionPolicy value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { + this.conflictResolutionPolicy = conflictResolutionPolicy; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IncludedPath.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IncludedPath.java new file mode 100644 index 000000000000..6b4ab59de343 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IncludedPath.java @@ -0,0 +1,71 @@ +/** + * 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.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The paths that are included in indexing. + */ +public class IncludedPath { + /** + * The path for which the indexing behavior applies to. Index paths + * typically start with root and end with wildcard (/path/*). + */ + @JsonProperty(value = "path") + private String path; + + /** + * List of indexes for this path. + */ + @JsonProperty(value = "indexes") + private List indexes; + + /** + * Get the path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*). + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*). + * + * @param path the path value to set + * @return the IncludedPath object itself. + */ + public IncludedPath withPath(String path) { + this.path = path; + return this; + } + + /** + * Get list of indexes for this path. + * + * @return the indexes value + */ + public List indexes() { + return this.indexes; + } + + /** + * Set list of indexes for this path. + * + * @param indexes the indexes value to set + * @return the IncludedPath object itself. + */ + public IncludedPath withIndexes(List indexes) { + this.indexes = indexes; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexKind.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexKind.java new file mode 100644 index 000000000000..969579bc7f6f --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexKind.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IndexKind. + */ +public final class IndexKind extends ExpandableStringEnum { + /** Static value Hash for IndexKind. */ + public static final IndexKind HASH = fromString("Hash"); + + /** Static value Range for IndexKind. */ + public static final IndexKind RANGE = fromString("Range"); + + /** Static value Spatial for IndexKind. */ + public static final IndexKind SPATIAL = fromString("Spatial"); + + /** + * Creates or finds a IndexKind from its string representation. + * @param name a name to look for + * @return the corresponding IndexKind + */ + @JsonCreator + public static IndexKind fromString(String name) { + return fromString(name, IndexKind.class); + } + + /** + * @return known IndexKind values + */ + public static Collection values() { + return values(IndexKind.class); + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Indexes.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Indexes.java new file mode 100644 index 000000000000..8247b1c30f3c --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Indexes.java @@ -0,0 +1,98 @@ +/** + * 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.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The indexes for the path. + */ +public class Indexes { + /** + * The datatype for which the indexing behavior is applied to. Possible + * values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', + * 'MultiPolygon'. + */ + @JsonProperty(value = "dataType") + private DataType dataType; + + /** + * The precision of the index. -1 is maximum precision. + */ + @JsonProperty(value = "precision") + private Integer precision; + + /** + * Indicates the type of index. Possible values include: 'Hash', 'Range', + * 'Spatial'. + */ + @JsonProperty(value = "kind") + private IndexKind kind; + + /** + * Get the datatype for which the indexing behavior is applied to. Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon'. + * + * @return the dataType value + */ + public DataType dataType() { + return this.dataType; + } + + /** + * Set the datatype for which the indexing behavior is applied to. Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon'. + * + * @param dataType the dataType value to set + * @return the Indexes object itself. + */ + public Indexes withDataType(DataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the precision of the index. -1 is maximum precision. + * + * @return the precision value + */ + public Integer precision() { + return this.precision; + } + + /** + * Set the precision of the index. -1 is maximum precision. + * + * @param precision the precision value to set + * @return the Indexes object itself. + */ + public Indexes withPrecision(Integer precision) { + this.precision = precision; + return this; + } + + /** + * Get indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial'. + * + * @return the kind value + */ + public IndexKind kind() { + return this.kind; + } + + /** + * Set indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial'. + * + * @param kind the kind value to set + * @return the Indexes object itself. + */ + public Indexes withKind(IndexKind kind) { + this.kind = kind; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingMode.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingMode.java new file mode 100644 index 000000000000..2a4725d3e288 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingMode.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IndexingMode. + */ +public final class IndexingMode extends ExpandableStringEnum { + /** Static value Consistent for IndexingMode. */ + public static final IndexingMode CONSISTENT = fromString("Consistent"); + + /** Static value Lazy for IndexingMode. */ + public static final IndexingMode LAZY = fromString("Lazy"); + + /** Static value None for IndexingMode. */ + public static final IndexingMode NONE = fromString("None"); + + /** + * Creates or finds a IndexingMode from its string representation. + * @param name a name to look for + * @return the corresponding IndexingMode + */ + @JsonCreator + public static IndexingMode fromString(String name) { + return fromString(name, IndexingMode.class); + } + + /** + * @return known IndexingMode values + */ + public static Collection values() { + return values(IndexingMode.class); + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingPolicy.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingPolicy.java new file mode 100644 index 000000000000..728ee3d8ac25 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingPolicy.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB indexing policy. + */ +public class IndexingPolicy { + /** + * Indicates if the indexing policy is automatic. + */ + @JsonProperty(value = "automatic") + private Boolean automatic; + + /** + * Indicates the indexing mode. Possible values include: 'Consistent', + * 'Lazy', 'None'. + */ + @JsonProperty(value = "indexingMode") + private IndexingMode indexingMode; + + /** + * List of paths to include in the indexing. + */ + @JsonProperty(value = "includedPaths") + private List includedPaths; + + /** + * List of paths to exclude from indexing. + */ + @JsonProperty(value = "excludedPaths") + private List excludedPaths; + + /** + * Get indicates if the indexing policy is automatic. + * + * @return the automatic value + */ + public Boolean automatic() { + return this.automatic; + } + + /** + * Set indicates if the indexing policy is automatic. + * + * @param automatic the automatic value to set + * @return the IndexingPolicy object itself. + */ + public IndexingPolicy withAutomatic(Boolean automatic) { + this.automatic = automatic; + return this; + } + + /** + * Get indicates the indexing mode. Possible values include: 'Consistent', 'Lazy', 'None'. + * + * @return the indexingMode value + */ + public IndexingMode indexingMode() { + return this.indexingMode; + } + + /** + * Set indicates the indexing mode. Possible values include: 'Consistent', 'Lazy', 'None'. + * + * @param indexingMode the indexingMode value to set + * @return the IndexingPolicy object itself. + */ + public IndexingPolicy withIndexingMode(IndexingMode indexingMode) { + this.indexingMode = indexingMode; + return this; + } + + /** + * Get list of paths to include in the indexing. + * + * @return the includedPaths value + */ + public List includedPaths() { + return this.includedPaths; + } + + /** + * Set list of paths to include in the indexing. + * + * @param includedPaths the includedPaths value to set + * @return the IndexingPolicy object itself. + */ + public IndexingPolicy withIncludedPaths(List includedPaths) { + this.includedPaths = includedPaths; + return this; + } + + /** + * Get list of paths to exclude from indexing. + * + * @return the excludedPaths value + */ + public List excludedPaths() { + return this.excludedPaths; + } + + /** + * Set list of paths to exclude from indexing. + * + * @param excludedPaths the excludedPaths value to set + * @return the IndexingPolicy object itself. + */ + public IndexingPolicy withExcludedPaths(List excludedPaths) { + this.excludedPaths = excludedPaths; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollection.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollection.java new file mode 100644 index 000000000000..58c275266a0a --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollection.java @@ -0,0 +1,140 @@ +/** + * 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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MongoDBCollectionInner; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing MongoDBCollection. + */ +public interface MongoDBCollection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the indexes value. + */ + List indexes(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mongoDBCollectionId value. + */ + String mongoDBCollectionId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the shardKey value. + */ + Map shardKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the MongoDBCollection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of MongoDBCollection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MongoDBCollection definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the mongodbcollection definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, accountName, databaseName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @param databaseName Cosmos DB database name + * @return the next definition stage + */ + WithOptions withExistingDatabasis(String resourceGroupName, String accountName, String databaseName); + } + + /** + * The stage of the mongodbcollection definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the mongodbcollection definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a MongoDB collection + * @return the next definition stage + */ + WithCreate withResource(MongoDBCollectionResource resource); + } + + /** + * 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 { + } + } + /** + * The template for a MongoDBCollection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of MongoDBCollection update stages. + */ + interface UpdateStages { + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionCreateUpdateParameters.java new file mode 100644 index 000000000000..1ee105c96f07 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB MongoDB collection. + */ +@JsonFlatten +public class MongoDBCollectionCreateUpdateParameters { + /** + * The standard JSON format of a MongoDB collection. + */ + @JsonProperty(value = "properties.resource", required = true) + private MongoDBCollectionResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a MongoDB collection. + * + * @return the resource value + */ + public MongoDBCollectionResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a MongoDB collection. + * + * @param resource the resource value to set + * @return the MongoDBCollectionCreateUpdateParameters object itself. + */ + public MongoDBCollectionCreateUpdateParameters withResource(MongoDBCollectionResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the MongoDBCollectionCreateUpdateParameters object itself. + */ + public MongoDBCollectionCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionResource.java new file mode 100644 index 000000000000..c51928decc5b --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionResource.java @@ -0,0 +1,97 @@ +/** + * 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.v2015_04_08; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB collection resource object. + */ +public class MongoDBCollectionResource { + /** + * Name of the Cosmos DB MongoDB collection. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * A key-value pair of shard keys to be applied for the request. + */ + @JsonProperty(value = "shardKey") + private Map shardKey; + + /** + * List of index keys. + */ + @JsonProperty(value = "indexes") + private List indexes; + + /** + * Get name of the Cosmos DB MongoDB collection. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB MongoDB collection. + * + * @param id the id value to set + * @return the MongoDBCollectionResource object itself. + */ + public MongoDBCollectionResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get a key-value pair of shard keys to be applied for the request. + * + * @return the shardKey value + */ + public Map shardKey() { + return this.shardKey; + } + + /** + * Set a key-value pair of shard keys to be applied for the request. + * + * @param shardKey the shardKey value to set + * @return the MongoDBCollectionResource object itself. + */ + public MongoDBCollectionResource withShardKey(Map shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get list of index keys. + * + * @return the indexes value + */ + public List indexes() { + return this.indexes; + } + + /** + * Set list of index keys. + * + * @param indexes the indexes value to set + * @return the MongoDBCollectionResource object itself. + */ + public MongoDBCollectionResource withIndexes(List indexes) { + this.indexes = indexes; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabase.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabase.java new file mode 100644 index 000000000000..bb3b51f8538f --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabase.java @@ -0,0 +1,51 @@ +/** + * 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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MongoDBDatabaseInner; +import java.util.Map; + +/** + * Type representing MongoDBDatabase. + */ +public interface MongoDBDatabase extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mongoDBDatabaseId value. + */ + String mongoDBDatabaseId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseCreateUpdateParameters.java new file mode 100644 index 000000000000..a1a057c8c293 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB MongoDB database. + */ +@JsonFlatten +public class MongoDBDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a MongoDB database. + */ + @JsonProperty(value = "properties.resource", required = true) + private MongoDBDatabaseResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a MongoDB database. + * + * @return the resource value + */ + public MongoDBDatabaseResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a MongoDB database. + * + * @param resource the resource value to set + * @return the MongoDBDatabaseCreateUpdateParameters object itself. + */ + public MongoDBDatabaseCreateUpdateParameters withResource(MongoDBDatabaseResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the MongoDBDatabaseCreateUpdateParameters object itself. + */ + public MongoDBDatabaseCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseResource.java new file mode 100644 index 000000000000..adfaa17cba3d --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB database id object. + */ +public class MongoDBDatabaseResource { + /** + * Name of the Cosmos DB MongoDB database. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB MongoDB database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB MongoDB database. + * + * @param id the id value to set + * @return the MongoDBDatabaseResource object itself. + */ + public MongoDBDatabaseResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndex.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndex.java new file mode 100644 index 000000000000..8d10eb94fdc3 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndex.java @@ -0,0 +1,69 @@ +/** + * 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.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB collection index key. + */ +public class MongoIndex { + /** + * Cosmos DB MongoDB collection index keys. + */ + @JsonProperty(value = "key") + private MongoIndexKeys key; + + /** + * Cosmos DB MongoDB collection index key options. + */ + @JsonProperty(value = "options") + private MongoIndexOptions options; + + /** + * Get cosmos DB MongoDB collection index keys. + * + * @return the key value + */ + public MongoIndexKeys key() { + return this.key; + } + + /** + * Set cosmos DB MongoDB collection index keys. + * + * @param key the key value to set + * @return the MongoIndex object itself. + */ + public MongoIndex withKey(MongoIndexKeys key) { + this.key = key; + return this; + } + + /** + * Get cosmos DB MongoDB collection index key options. + * + * @return the options value + */ + public MongoIndexOptions options() { + return this.options; + } + + /** + * Set cosmos DB MongoDB collection index key options. + * + * @param options the options value to set + * @return the MongoIndex object itself. + */ + public MongoIndex withOptions(MongoIndexOptions options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexKeys.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexKeys.java new file mode 100644 index 000000000000..9482984bd19e --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexKeys.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB collection resource object. + */ +public class MongoIndexKeys { + /** + * List of keys for each MongoDB collection in the Azure Cosmos DB service. + */ + @JsonProperty(value = "keys") + private List keys; + + /** + * Get list of keys for each MongoDB collection in the Azure Cosmos DB service. + * + * @return the keys value + */ + public List keys() { + return this.keys; + } + + /** + * Set list of keys for each MongoDB collection in the Azure Cosmos DB service. + * + * @param keys the keys value to set + * @return the MongoIndexKeys object itself. + */ + public MongoIndexKeys withKeys(List keys) { + this.keys = keys; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexOptions.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexOptions.java new file mode 100644 index 000000000000..d2b9d94acc5a --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexOptions.java @@ -0,0 +1,69 @@ +/** + * 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.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB collection index options. + */ +public class MongoIndexOptions { + /** + * Expire after seconds. + */ + @JsonProperty(value = "expireAfterSeconds") + private Integer expireAfterSeconds; + + /** + * Is unique or not. + */ + @JsonProperty(value = "unique") + private Boolean unique; + + /** + * Get expire after seconds. + * + * @return the expireAfterSeconds value + */ + public Integer expireAfterSeconds() { + return this.expireAfterSeconds; + } + + /** + * Set expire after seconds. + * + * @param expireAfterSeconds the expireAfterSeconds value to set + * @return the MongoIndexOptions object itself. + */ + public MongoIndexOptions withExpireAfterSeconds(Integer expireAfterSeconds) { + this.expireAfterSeconds = expireAfterSeconds; + return this; + } + + /** + * Get is unique or not. + * + * @return the unique value + */ + public Boolean unique() { + return this.unique; + } + + /** + * Set is unique or not. + * + * @param unique the unique value to set + * @return the MongoIndexOptions object itself. + */ + public MongoIndexOptions withUnique(Boolean unique) { + this.unique = unique; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operation.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operation.java index 5e818fbdb555..e7b6d0f15616 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operation.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operation.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.OperationInner; /** * Type representing Operation. */ -public interface Operation extends HasInner, HasManager { +public interface Operation extends HasInner, HasManager { /** * @return the display value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKind.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKind.java new file mode 100644 index 000000000000..5f71ad325e81 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKind.java @@ -0,0 +1,41 @@ +/** + * 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.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PartitionKind. + */ +public final class PartitionKind extends ExpandableStringEnum { + /** Static value Hash for PartitionKind. */ + public static final PartitionKind HASH = fromString("Hash"); + + /** Static value Range for PartitionKind. */ + public static final PartitionKind RANGE = fromString("Range"); + + /** + * Creates or finds a PartitionKind from its string representation. + * @param name a name to look for + * @return the corresponding PartitionKind + */ + @JsonCreator + public static PartitionKind fromString(String name) { + return fromString(name, PartitionKind.class); + } + + /** + * @return known PartitionKind values + */ + public static Collection values() { + return values(PartitionKind.class); + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionMetric.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionMetric.java index 11bc2c53eabe..f71b2da26643 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionMetric.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionMetric.java @@ -10,7 +10,7 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PartitionMetricInner; import org.joda.time.DateTime; import java.util.List; @@ -18,7 +18,7 @@ /** * Type representing PartitionMetric. */ -public interface PartitionMetric extends HasInner, HasManager { +public interface PartitionMetric extends HasInner, HasManager { /** * @return the endTime value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionUsage.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionUsage.java index 847e364e86b7..4539c8a466f4 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionUsage.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionUsage.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PartitionUsageInner; /** * Type representing PartitionUsage. */ -public interface PartitionUsage extends HasInner, HasManager { +public interface PartitionUsage extends HasInner, HasManager { /** * @return the currentValue value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetric.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetric.java index 7f2d36d57971..68e2b873d3ae 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetric.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetric.java @@ -10,7 +10,7 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DocumentDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PercentileMetricInner; import org.joda.time.DateTime; import java.util.List; @@ -18,7 +18,7 @@ /** * Type representing PercentileMetric. */ -public interface PercentileMetric extends HasInner, HasManager { +public interface PercentileMetric extends HasInner, HasManager { /** * @return the endTime value. */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainer.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainer.java new file mode 100644 index 000000000000..8aa6050c80c1 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainer.java @@ -0,0 +1,169 @@ +/** + * 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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.SqlContainerInner; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing SqlContainer. + */ +public interface SqlContainer extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the _etag value. + */ + String _etag(); + + /** + * @return the _rid value. + */ + String _rid(); + + /** + * @return the _ts value. + */ + Object _ts(); + + /** + * @return the conflictResolutionPolicy value. + */ + ConflictResolutionPolicy conflictResolutionPolicy(); + + /** + * @return the defaultTtl value. + */ + Integer defaultTtl(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the indexingPolicy value. + */ + IndexingPolicy indexingPolicy(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partitionKey value. + */ + ContainerPartitionKey partitionKey(); + + /** + * @return the sqlContainerId value. + */ + String sqlContainerId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueKeyPolicy value. + */ + UniqueKeyPolicy uniqueKeyPolicy(); + + /** + * The entirety of the SqlContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of SqlContainer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SqlContainer definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the sqlcontainer definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, accountName, databaseName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @param databaseName Cosmos DB database name + * @return the next definition stage + */ + WithOptions withExistingDatabasis(String resourceGroupName, String accountName, String databaseName); + } + + /** + * The stage of the sqlcontainer definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the sqlcontainer definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a container + * @return the next definition stage + */ + WithCreate withResource(SqlContainerResource resource); + } + + /** + * 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 { + } + } + /** + * The template for a SqlContainer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of SqlContainer update stages. + */ + interface UpdateStages { + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerCreateUpdateParameters.java new file mode 100644 index 000000000000..de221fb26b77 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB container. + */ +@JsonFlatten +public class SqlContainerCreateUpdateParameters { + /** + * The standard JSON format of a container. + */ + @JsonProperty(value = "properties.resource", required = true) + private SqlContainerResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a container. + * + * @return the resource value + */ + public SqlContainerResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a container. + * + * @param resource the resource value to set + * @return the SqlContainerCreateUpdateParameters object itself. + */ + public SqlContainerCreateUpdateParameters withResource(SqlContainerResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the SqlContainerCreateUpdateParameters object itself. + */ + public SqlContainerCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerResource.java new file mode 100644 index 000000000000..b2f37621d9af --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB SQL container resource object. + */ +public class SqlContainerResource { + /** + * Name of the Cosmos DB SQL container. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The configuration of the indexing policy. By default, the indexing is + * automatic for all document paths within the container. + */ + @JsonProperty(value = "indexingPolicy") + private IndexingPolicy indexingPolicy; + + /** + * The configuration of the partition key to be used for partitioning data + * into multiple partitions. + */ + @JsonProperty(value = "partitionKey") + private ContainerPartitionKey partitionKey; + + /** + * Default time to live. + */ + @JsonProperty(value = "defaultTtl") + private Integer defaultTtl; + + /** + * The unique key policy configuration for specifying uniqueness + * constraints on documents in the collection in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "uniqueKeyPolicy") + private UniqueKeyPolicy uniqueKeyPolicy; + + /** + * The conflict resolution policy for the container. + */ + @JsonProperty(value = "conflictResolutionPolicy") + private ConflictResolutionPolicy conflictResolutionPolicy; + + /** + * Get name of the Cosmos DB SQL container. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB SQL container. + * + * @param id the id value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + * + * @return the indexingPolicy value + */ + public IndexingPolicy indexingPolicy() { + return this.indexingPolicy; + } + + /** + * Set the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + * + * @param indexingPolicy the indexingPolicy value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withIndexingPolicy(IndexingPolicy indexingPolicy) { + this.indexingPolicy = indexingPolicy; + return this; + } + + /** + * Get the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @return the partitionKey value + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Set the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @param partitionKey the partitionKey value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withPartitionKey(ContainerPartitionKey partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get default time to live. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set default time to live. + * + * @param defaultTtl the defaultTtl value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeyPolicy value + */ + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.uniqueKeyPolicy; + } + + /** + * Set the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeyPolicy the uniqueKeyPolicy value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { + this.uniqueKeyPolicy = uniqueKeyPolicy; + return this; + } + + /** + * Get the conflict resolution policy for the container. + * + * @return the conflictResolutionPolicy value + */ + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.conflictResolutionPolicy; + } + + /** + * Set the conflict resolution policy for the container. + * + * @param conflictResolutionPolicy the conflictResolutionPolicy value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { + this.conflictResolutionPolicy = conflictResolutionPolicy; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabase.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabase.java new file mode 100644 index 000000000000..d397725febaa --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabase.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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.SqlDatabaseInner; +import com.microsoft.azure.arm.model.Indexable; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing SqlDatabase. + */ +public interface SqlDatabase extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the _colls value. + */ + String _colls(); + + /** + * @return the _etag value. + */ + String _etag(); + + /** + * @return the _rid value. + */ + String _rid(); + + /** + * @return the _ts value. + */ + Object _ts(); + + /** + * @return the _users value. + */ + String _users(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sqlDatabaseId value. + */ + String sqlDatabaseId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the SqlDatabase definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApi, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of SqlDatabase definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SqlDatabase definition. + */ + interface Blank extends WithApi { + } + + /** + * The stage of the sqldatabase definition allowing to specify Api. + */ + interface WithApi { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithOptions withExistingApi(String resourceGroupName, String accountName); + } + + /** + * The stage of the sqldatabase definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the sqldatabase definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a SQL database + * @return the next definition stage + */ + WithCreate withResource(SqlDatabaseResource resource); + } + + /** + * 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 { + } + } + /** + * The template for a SqlDatabase update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of SqlDatabase update stages. + */ + interface UpdateStages { + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseCreateUpdateParameters.java new file mode 100644 index 000000000000..7506ffb9f927 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB SQL database. + */ +@JsonFlatten +public class SqlDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a SQL database. + */ + @JsonProperty(value = "properties.resource", required = true) + private SqlDatabaseResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a SQL database. + * + * @return the resource value + */ + public SqlDatabaseResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a SQL database. + * + * @param resource the resource value to set + * @return the SqlDatabaseCreateUpdateParameters object itself. + */ + public SqlDatabaseCreateUpdateParameters withResource(SqlDatabaseResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the SqlDatabaseCreateUpdateParameters object itself. + */ + public SqlDatabaseCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseResource.java new file mode 100644 index 000000000000..9608b2492320 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB SQL database id object. + */ +public class SqlDatabaseResource { + /** + * Name of the Cosmos DB SQL database. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB SQL database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB SQL database. + * + * @param id the id value to set + * @return the SqlDatabaseResource object itself. + */ + public SqlDatabaseResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Table.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Table.java new file mode 100644 index 000000000000..cf4de7502793 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Table.java @@ -0,0 +1,127 @@ +/** + * 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.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.TableInner; +import com.microsoft.azure.arm.model.Indexable; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing Table. + */ +public interface Table extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tableId value. + */ + String tableId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Table definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApi, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of Table definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Table definition. + */ + interface Blank extends WithApi { + } + + /** + * The stage of the table definition allowing to specify Api. + */ + interface WithApi { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithOptions withExistingApi(String resourceGroupName, String accountName); + } + + /** + * The stage of the table definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the table definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a Table + * @return the next definition stage + */ + WithCreate withResource(TableResource resource); + } + + /** + * 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
{ + } + } + /** + * The template for a Table update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable
{ + } + + /** + * Grouping of Table update stages. + */ + interface UpdateStages { + } +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableCreateUpdateParameters.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableCreateUpdateParameters.java new file mode 100644 index 000000000000..0b58765ed7e5 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableCreateUpdateParameters.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Table. + */ +@JsonFlatten +public class TableCreateUpdateParameters { + /** + * The standard JSON format of a Table. + */ + @JsonProperty(value = "properties.resource", required = true) + private TableResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Table. + * + * @return the resource value + */ + public TableResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Table. + * + * @param resource the resource value to set + * @return the TableCreateUpdateParameters object itself. + */ + public TableCreateUpdateParameters withResource(TableResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the TableCreateUpdateParameters object itself. + */ + public TableCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableResource.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableResource.java new file mode 100644 index 000000000000..f3b170475738 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB table id object. + */ +public class TableResource { + /** + * Name of the Cosmos DB table. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB table. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB table. + * + * @param id the id value to set + * @return the TableResource object itself. + */ + public TableResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKey.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKey.java new file mode 100644 index 000000000000..c72daed99369 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKey.java @@ -0,0 +1,46 @@ +/** + * 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.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The unique key on that enforces uniqueness constraint on documents in the + * collection in the Azure Cosmos DB service. + */ +public class UniqueKey { + /** + * List of paths must be unique for each document in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Get list of paths must be unique for each document in the Azure Cosmos DB service. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set list of paths must be unique for each document in the Azure Cosmos DB service. + * + * @param paths the paths value to set + * @return the UniqueKey object itself. + */ + public UniqueKey withPaths(List paths) { + this.paths = paths; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKeyPolicy.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKeyPolicy.java new file mode 100644 index 000000000000..1bfd818277ce --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKeyPolicy.java @@ -0,0 +1,46 @@ +/** + * 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.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The unique key policy configuration for specifying uniqueness constraints on + * documents in the collection in the Azure Cosmos DB service. + */ +public class UniqueKeyPolicy { + /** + * List of unique keys on that enforces uniqueness constraint on documents + * in the collection in the Azure Cosmos DB service. + */ + @JsonProperty(value = "uniqueKeys") + private List uniqueKeys; + + /** + * Get list of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeys value + */ + public List uniqueKeys() { + return this.uniqueKeys; + } + + /** + * Set list of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeys the uniqueKeys value to set + * @return the UniqueKeyPolicy object itself. + */ + public UniqueKeyPolicy withUniqueKeys(List uniqueKeys) { + this.uniqueKeys = uniqueKeys; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/VirtualNetworkRule.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/VirtualNetworkRule.java index 00f0f258d491..ff9af2f8c263 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/VirtualNetworkRule.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/VirtualNetworkRule.java @@ -21,6 +21,13 @@ public class VirtualNetworkRule { @JsonProperty(value = "id") private String id; + /** + * Create firewall rule before the virtual network has vnet service + * endpoint enabled. + */ + @JsonProperty(value = "ignoreMissingVNetServiceEndpoint") + private Boolean ignoreMissingVNetServiceEndpoint; + /** * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. * @@ -41,4 +48,24 @@ public VirtualNetworkRule withId(String id) { return this; } + /** + * Get create firewall rule before the virtual network has vnet service endpoint enabled. + * + * @return the ignoreMissingVNetServiceEndpoint value + */ + public Boolean ignoreMissingVNetServiceEndpoint() { + return this.ignoreMissingVNetServiceEndpoint; + } + + /** + * Set create firewall rule before the virtual network has vnet service endpoint enabled. + * + * @param ignoreMissingVNetServiceEndpoint the ignoreMissingVNetServiceEndpoint value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withIgnoreMissingVNetServiceEndpoint(Boolean ignoreMissingVNetServiceEndpoint) { + this.ignoreMissingVNetServiceEndpoint = ignoreMissingVNetServiceEndpoint; + return this; + } + } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceImpl.java new file mode 100644 index 000000000000..f4d1d9eea295 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceImpl.java @@ -0,0 +1,145 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspace; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspaceCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspaceResource; +import rx.functions.Func1; + +class CassandraKeyspaceImpl extends CreatableUpdatableImpl implements CassandraKeyspace, CassandraKeyspace.Definition, CassandraKeyspace.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String keyspaceName; + private CassandraKeyspaceCreateUpdateParameters createOrUpdateParameter; + + CassandraKeyspaceImpl(String name, CosmosDBManager manager) { + super(name, new CassandraKeyspaceInner()); + this.manager = manager; + // Set resource name + this.keyspaceName = name; + // + this.createOrUpdateParameter = new CassandraKeyspaceCreateUpdateParameters(); + } + + CassandraKeyspaceImpl(CassandraKeyspaceInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.keyspaceName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.keyspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "keyspaces"); + // + this.createOrUpdateParameter = new CassandraKeyspaceCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateCassandraKeyspaceAsync(this.resourceGroupName, this.accountName, this.keyspaceName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public CassandraKeyspaceInner call(CassandraKeyspaceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateCassandraKeyspaceAsync(this.resourceGroupName, this.accountName, this.keyspaceName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public CassandraKeyspaceInner call(CassandraKeyspaceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new CassandraKeyspaceCreateUpdateParameters(); + } + + @Override + public String cassandraKeyspaceId() { + return this.inner().cassandraKeyspaceId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CassandraKeyspaceImpl withExistingApi(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public CassandraKeyspaceImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public CassandraKeyspaceImpl withResource(CassandraKeyspaceResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceInner.java new file mode 100644 index 000000000000..64caae7529ea --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceInner.java @@ -0,0 +1,48 @@ +/** + * 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.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Cassandra keyspace. + */ +@JsonFlatten +@SkipParentValidation +public class CassandraKeyspaceInner extends Resource { + /** + * Name of the Cosmos DB Cassandra keyspace. + */ + @JsonProperty(value = "properties.id", required = true) + private String cassandraKeyspaceId; + + /** + * Get name of the Cosmos DB Cassandra keyspace. + * + * @return the cassandraKeyspaceId value + */ + public String cassandraKeyspaceId() { + return this.cassandraKeyspaceId; + } + + /** + * Set name of the Cosmos DB Cassandra keyspace. + * + * @param cassandraKeyspaceId the cassandraKeyspaceId value to set + * @return the CassandraKeyspaceInner object itself. + */ + public CassandraKeyspaceInner withCassandraKeyspaceId(String cassandraKeyspaceId) { + this.cassandraKeyspaceId = cassandraKeyspaceId; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableImpl.java new file mode 100644 index 000000000000..ffca343b0776 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableImpl.java @@ -0,0 +1,68 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraTable; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraSchema; +import java.util.Map; + +class CassandraTableImpl extends WrapperImpl implements CassandraTable { + private final CosmosDBManager manager; + CassandraTableImpl(CassandraTableInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String cassandraTableId() { + return this.inner().cassandraTableId(); + } + + @Override + public Integer defaultTtl() { + return this.inner().defaultTtl(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public CassandraSchema schema() { + return this.inner().schema(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableInner.java new file mode 100644 index 000000000000..d6ee6d4d7d3c --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableInner.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraSchema; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Cassandra table. + */ +@JsonFlatten +@SkipParentValidation +public class CassandraTableInner extends Resource { + /** + * Name of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "properties.id", required = true) + private String cassandraTableId; + + /** + * Time to live of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "properties.defaultTtl") + private Integer defaultTtl; + + /** + * Schema of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "properties.schema") + private CassandraSchema schema; + + /** + * Get name of the Cosmos DB Cassandra table. + * + * @return the cassandraTableId value + */ + public String cassandraTableId() { + return this.cassandraTableId; + } + + /** + * Set name of the Cosmos DB Cassandra table. + * + * @param cassandraTableId the cassandraTableId value to set + * @return the CassandraTableInner object itself. + */ + public CassandraTableInner withCassandraTableId(String cassandraTableId) { + this.cassandraTableId = cassandraTableId; + return this; + } + + /** + * Get time to live of the Cosmos DB Cassandra table. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set time to live of the Cosmos DB Cassandra table. + * + * @param defaultTtl the defaultTtl value to set + * @return the CassandraTableInner object itself. + */ + public CassandraTableInner withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get schema of the Cosmos DB Cassandra table. + * + * @return the schema value + */ + public CassandraSchema schema() { + return this.schema; + } + + /** + * Set schema of the Cosmos DB Cassandra table. + * + * @param schema the schema value to set + * @return the CassandraTableInner object itself. + */ + public CassandraTableInner withSchema(CassandraSchema schema) { + this.schema = schema; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java index 9740d4454a4f..02371675fc10 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java @@ -18,15 +18,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class CollectionDatabasisDatabaseAccountMetricDefinitionImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetricDefinition { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - CollectionDatabasisDatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, DocumentDBManager manager) { + CollectionDatabasisDatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java index 4da43274b3ce..7466fb10b2b5 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java @@ -18,15 +18,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class CollectionDatabasisDatabaseAccountMetricImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetric { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - CollectionDatabasisDatabaseAccountMetricImpl(MetricInner inner, DocumentDBManager manager) { + CollectionDatabasisDatabaseAccountMetricImpl(MetricInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java index e4eb3cabfc6c..5f815efff1d9 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java @@ -18,15 +18,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class CollectionDatabasisDatabaseAccountMetricModelImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetricModel { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - CollectionDatabasisDatabaseAccountMetricModelImpl(MetricInner inner, DocumentDBManager manager) { + CollectionDatabasisDatabaseAccountMetricModelImpl(MetricInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java index 772bde1ba255..58bff3568d7d 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java @@ -15,15 +15,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class CollectionDatabasisDatabaseAccountUsageImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountUsage { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - CollectionDatabasisDatabaseAccountUsageImpl(UsageInner inner, DocumentDBManager manager) { + CollectionDatabasisDatabaseAccountUsageImpl(UsageInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java index d01841ba9641..6609614351ce 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric; class CollectionPartitionRegionsImpl extends WrapperImpl implements CollectionPartitionRegions { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - CollectionPartitionRegionsImpl(DocumentDBManager manager) { + CollectionPartitionRegionsImpl(CosmosDBManager manager) { super(manager.inner().collectionPartitionRegions()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsImpl.java index b5d97383a1db..339fc60ee5b2 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsImpl.java @@ -18,14 +18,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionUsage; class CollectionPartitionsImpl extends WrapperImpl implements CollectionPartitions { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - CollectionPartitionsImpl(DocumentDBManager manager) { + CollectionPartitionsImpl(CosmosDBManager manager) { super(manager.inner().collectionPartitions()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsImpl.java index 4a336d95fd42..137254e531a3 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetricModel; class CollectionRegionsImpl extends WrapperImpl implements CollectionRegions { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - CollectionRegionsImpl(DocumentDBManager manager) { + CollectionRegionsImpl(CosmosDBManager manager) { super(manager.inner().collectionRegions()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsImpl.java index 30fd87c48f14..60accebd7f34 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsImpl.java @@ -19,14 +19,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountUsage; class CollectionsImpl extends WrapperImpl implements Collections { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - CollectionsImpl(DocumentDBManager manager) { + CollectionsImpl(CosmosDBManager manager) { super(manager.inner().collections()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsInner.java index c2f14d867cc8..ab97fe3d5c45 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsInner.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsInner.java @@ -387,7 +387,7 @@ private ServiceResponse> listUsagesDelegate(Response listMetricDefinitions(String resourceGroupNam } /** - * Retrieves metric defintions for the given collection. + * Retrieves metric definitions for the given collection. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. @@ -418,7 +418,7 @@ public ServiceFuture> listMetricDefinitionsAsync(Str } /** - * Retrieves metric defintions for the given collection. + * Retrieves metric definitions for the given collection. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. @@ -437,7 +437,7 @@ public List call(ServiceResponse { +public final class CosmosDBManager extends ManagerCore { private DatabaseAccounts databaseAccounts; private Operations operations; private Databases databases; @@ -50,22 +50,22 @@ public final class DocumentDBManager extends ManagerCore { /** - * Creates an instance of DocumentDBManager that exposes DocumentDB management API entry points. + * Creates an instance of CosmosDBManager that exposes CosmosDB management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID - * @return the interface exposing DocumentDB management API entry points that work across subscriptions + * @return the interface exposing CosmosDB management API entry points that work across subscriptions */ - DocumentDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + CosmosDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId); } /** @@ -230,11 +230,11 @@ public PartitionKeyRangeIdRegions partitionKeyRangeIdRegions() { * The implementation for Configurable interface. */ private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { - public DocumentDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { - return DocumentDBManager.authenticate(buildRestClient(credentials), subscriptionId); + public CosmosDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return CosmosDBManager.authenticate(buildRestClient(credentials), subscriptionId); } } - private DocumentDBManager(RestClient restClient, String subscriptionId) { + private CosmosDBManager(RestClient restClient, String subscriptionId) { super( restClient, subscriptionId, diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountImpl.java index d68594ebcdaf..e5a46bd84c6e 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountImpl.java @@ -23,10 +23,10 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.VirtualNetworkRule; import rx.functions.Func1; -class DatabaseAccountImpl extends GroupableResourceCoreImpl implements DatabaseAccount, DatabaseAccount.Definition, DatabaseAccount.Update { +class DatabaseAccountImpl extends GroupableResourceCoreImpl implements DatabaseAccount, DatabaseAccount.Definition, DatabaseAccount.Update { private DatabaseAccountCreateUpdateParameters createParameter; private DatabaseAccountPatchParameters updateParameter; - DatabaseAccountImpl(String name, DatabaseAccountInner inner, DocumentDBManager manager) { + DatabaseAccountImpl(String name, DatabaseAccountInner inner, CosmosDBManager manager) { super(name, inner, manager); this.createParameter = new DatabaseAccountCreateUpdateParameters(); this.updateParameter = new DatabaseAccountPatchParameters(); @@ -103,6 +103,11 @@ public Boolean enableAutomaticFailover() { return this.inner().enableAutomaticFailover(); } + @Override + public Boolean enableMultipleWriteLocations() { + return this.inner().enableMultipleWriteLocations(); + } + @Override public List failoverPolicies() { return this.inner().failoverPolicies(); @@ -167,6 +172,12 @@ public DatabaseAccountImpl withEnableAutomaticFailover(Boolean enableAutomaticFa return this; } + @Override + public DatabaseAccountImpl withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations) { + this.createParameter.withEnableMultipleWriteLocations(enableMultipleWriteLocations); + return this; + } + @Override public DatabaseAccountImpl withIpRangeFilter(String ipRangeFilter) { this.createParameter.withIpRangeFilter(ipRangeFilter); diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountInner.java index 836272e63490..ea984513227a 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountInner.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountInner.java @@ -18,12 +18,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.VirtualNetworkRule; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; import com.microsoft.azure.Resource; /** * An Azure Cosmos DB database account. */ @JsonFlatten +@SkipParentValidation public class DatabaseAccountInner extends Resource { /** * Indicates the type of database account. This can only be set at database @@ -113,6 +115,12 @@ public class DatabaseAccountInner extends Resource { @JsonProperty(value = "properties.virtualNetworkRules") private List virtualNetworkRules; + /** + * Enables the account to write in multiple locations. + */ + @JsonProperty(value = "properties.enableMultipleWriteLocations") + private Boolean enableMultipleWriteLocations; + /** * Get indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. * @@ -318,4 +326,24 @@ public DatabaseAccountInner withVirtualNetworkRules(List vir return this; } + /** + * Get enables the account to write in multiple locations. + * + * @return the enableMultipleWriteLocations value + */ + public Boolean enableMultipleWriteLocations() { + return this.enableMultipleWriteLocations; + } + + /** + * Set enables the account to write in multiple locations. + * + * @param enableMultipleWriteLocations the enableMultipleWriteLocations value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations) { + this.enableMultipleWriteLocations = enableMultipleWriteLocations; + return this; + } + } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultImpl.java index 3bc077a6f365..83f0407ab338 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultImpl.java @@ -14,14 +14,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountConnectionString; class DatabaseAccountListConnectionStringsResultImpl extends WrapperImpl implements DatabaseAccountListConnectionStringsResult { - private final DocumentDBManager manager; - DatabaseAccountListConnectionStringsResultImpl(DatabaseAccountListConnectionStringsResultInner inner, DocumentDBManager manager) { + private final CosmosDBManager manager; + DatabaseAccountListConnectionStringsResultImpl(DatabaseAccountListConnectionStringsResultInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultImpl.java index a9978ee957c9..294216cd35b8 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultImpl.java @@ -12,14 +12,14 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; class DatabaseAccountListKeysResultImpl extends WrapperImpl implements DatabaseAccountListKeysResult { - private final DocumentDBManager manager; - DatabaseAccountListKeysResultImpl(DatabaseAccountListKeysResultInner inner, DocumentDBManager manager) { + private final CosmosDBManager manager; + DatabaseAccountListKeysResultImpl(DatabaseAccountListKeysResultInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultImpl.java index 81c368b8aed1..1a7772993789 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultImpl.java @@ -12,14 +12,14 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; class DatabaseAccountListReadOnlyKeysResultImpl extends WrapperImpl implements DatabaseAccountListReadOnlyKeysResult { - private final DocumentDBManager manager; - DatabaseAccountListReadOnlyKeysResultImpl(DatabaseAccountListReadOnlyKeysResultInner inner, DocumentDBManager manager) { + private final CosmosDBManager manager; + DatabaseAccountListReadOnlyKeysResultImpl(DatabaseAccountListReadOnlyKeysResultInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricDefinitionImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricDefinitionImpl.java index da1772d33267..297f16c946b8 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricDefinitionImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricDefinitionImpl.java @@ -18,15 +18,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class DatabaseAccountMetricDefinitionImpl extends WrapperImpl implements DatabaseAccountMetricDefinition { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - DatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, DocumentDBManager manager) { + DatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricImpl.java index 0e8a5a3c5fd3..fcb8ff309923 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricImpl.java @@ -18,15 +18,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class DatabaseAccountMetricImpl extends WrapperImpl implements DatabaseAccountMetric { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - DatabaseAccountMetricImpl(MetricInner inner, DocumentDBManager manager) { + DatabaseAccountMetricImpl(MetricInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsImpl.java index 7b398f340510..560a33bc7508 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetric; class DatabaseAccountRegionsImpl extends WrapperImpl implements DatabaseAccountRegions { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - DatabaseAccountRegionsImpl(DocumentDBManager manager) { + DatabaseAccountRegionsImpl(CosmosDBManager manager) { super(manager.inner().databaseAccountRegions()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountUsageImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountUsageImpl.java index 7d159d974fd6..3a6d51e296e8 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountUsageImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountUsageImpl.java @@ -15,15 +15,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class DatabaseAccountUsageImpl extends WrapperImpl implements DatabaseAccountUsage { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - DatabaseAccountUsageImpl(UsageInner inner, DocumentDBManager manager) { + DatabaseAccountUsageImpl(UsageInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsImpl.java index b02f3864ab07..0de3c02ab87d 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsImpl.java @@ -31,9 +31,21 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetric; import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountUsage; import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetricDefinition; - -class DatabaseAccountsImpl extends GroupableResourcesCoreImpl implements DatabaseAccounts { - protected DatabaseAccountsImpl(DocumentDBManager manager) { +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabase; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBDatabase; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinDatabase; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainer; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollection; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Table; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraTable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraTableCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspace; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraph; + +class DatabaseAccountsImpl extends GroupableResourcesCoreImpl implements DatabaseAccounts { + protected DatabaseAccountsImpl(CosmosDBManager manager) { super(manager.inner().databaseAccounts(), manager); } @@ -204,6 +216,60 @@ protected DatabaseAccountImpl wrapModel(String name) { return new DatabaseAccountImpl(name, new DatabaseAccountInner(), this.manager()); } + @Override + public SqlDatabaseImpl defineDatabasis(String name) { + return wrapDatabasisModel(name); + } + + @Override + public SqlContainerImpl defineContainer(String name) { + return wrapContainerModel(name); + } + + @Override + public MongoDBCollectionImpl defineCollection(String name) { + return wrapCollectionModel(name); + } + + @Override + public TableImpl defineTable(String name) { + return wrapTableModel(name); + } + + @Override + public CassandraKeyspaceImpl defineKeyspace(String name) { + return wrapKeyspaceModel(name); + } + + @Override + public GremlinGraphImpl defineGraph(String name) { + return wrapGraphModel(name); + } + + private SqlDatabaseImpl wrapDatabasisModel(String name) { + return new SqlDatabaseImpl(name, this.manager()); + } + + private SqlContainerImpl wrapContainerModel(String name) { + return new SqlContainerImpl(name, this.manager()); + } + + private MongoDBCollectionImpl wrapCollectionModel(String name) { + return new MongoDBCollectionImpl(name, this.manager()); + } + + private TableImpl wrapTableModel(String name) { + return new TableImpl(name, this.manager()); + } + + private CassandraKeyspaceImpl wrapKeyspaceModel(String name) { + return new CassandraKeyspaceImpl(name, this.manager()); + } + + private GremlinGraphImpl wrapGraphModel(String name) { + return new GremlinGraphImpl(name, this.manager()); + } + private DatabaseAccountMetricImpl wrapDatabaseAccountMetricModel(MetricInner inner) { return new DatabaseAccountMetricImpl(inner, manager()); } @@ -216,6 +282,57 @@ private DatabaseAccountMetricDefinitionImpl wrapDatabaseAccountMetricDefinitionM return new DatabaseAccountMetricDefinitionImpl(inner, manager()); } + private SqlDatabaseImpl wrapSqlDatabaseModel(SqlDatabaseInner inner) { + return new SqlDatabaseImpl(inner, manager()); + } + + private SqlContainerImpl wrapSqlContainerModel(SqlContainerInner inner) { + return new SqlContainerImpl(inner, manager()); + } + + private MongoDBCollectionImpl wrapMongoDBCollectionModel(MongoDBCollectionInner inner) { + return new MongoDBCollectionImpl(inner, manager()); + } + + private TableImpl wrapTableModel(TableInner inner) { + return new TableImpl(inner, manager()); + } + + private CassandraKeyspaceImpl wrapCassandraKeyspaceModel(CassandraKeyspaceInner inner) { + return new CassandraKeyspaceImpl(inner, manager()); + } + + private GremlinGraphImpl wrapGremlinGraphModel(GremlinGraphInner inner) { + return new GremlinGraphImpl(inner, manager()); + } + + private Observable getSqlContainerInnerUsingDatabaseAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); + String databaseName = IdParsingUtils.getValueFromIdByName(id, "databases"); + String containerName = IdParsingUtils.getValueFromIdByName(id, "containers"); + DatabaseAccountsInner client = this.inner(); + return client.getSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName); + } + + private Observable getMongoDBCollectionInnerUsingDatabaseAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); + String databaseName = IdParsingUtils.getValueFromIdByName(id, "databases"); + String collectionName = IdParsingUtils.getValueFromIdByName(id, "collections"); + DatabaseAccountsInner client = this.inner(); + return client.getMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName); + } + + private Observable getGremlinGraphInnerUsingDatabaseAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); + String databaseName = IdParsingUtils.getValueFromIdByName(id, "databases"); + String graphName = IdParsingUtils.getValueFromIdByName(id, "graphs"); + DatabaseAccountsInner client = this.inner(); + return client.getGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName); + } + @Override public Observable getReadOnlyKeysAsync(String resourceGroupName, String accountName) { DatabaseAccountsInner client = this.inner(); @@ -229,10 +346,10 @@ public DatabaseAccountListReadOnlyKeysResult call(DatabaseAccountListReadOnlyKey } @Override - public Completable checkNameExistsAsync(String accountName) { + public Observable checkNameExistsAsync(String accountName) { DatabaseAccountsInner client = this.inner(); - return client.checkNameExistsAsync(accountName).toCompletable(); - } + return client.checkNameExistsAsync(accountName) + ;} @Override public Observable listMetricsAsync(String resourceGroupName, String accountName, String filter) { @@ -288,4 +405,364 @@ public DatabaseAccountMetricDefinition call(MetricDefinitionInner inner) { }); } + @Override + public Observable listSqlDatabasesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listSqlDatabasesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SqlDatabase call(SqlDatabaseInner inner) { + return new SqlDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getSqlDatabaseAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public SqlDatabase call(SqlDatabaseInner inner) { + return new SqlDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName).toCompletable(); + } + + @Override + public Observable listMongoDBDatabasesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listMongoDBDatabasesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public MongoDBDatabase call(MongoDBDatabaseInner inner) { + return new MongoDBDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public MongoDBDatabase call(MongoDBDatabaseInner inner) { + return new MongoDBDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + DatabaseAccountsInner client = this.inner(); + return client.createUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters) + .map(new Func1() { + @Override + public MongoDBDatabase call(MongoDBDatabaseInner inner) { + return new MongoDBDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName).toCompletable(); + } + + @Override + public Observable listGremlinDatabasesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listGremlinDatabasesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public GremlinDatabase call(GremlinDatabaseInner inner) { + return new GremlinDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getGremlinDatabaseAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public GremlinDatabase call(GremlinDatabaseInner inner) { + return new GremlinDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable createUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + DatabaseAccountsInner client = this.inner(); + return client.createUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters) + .map(new Func1() { + @Override + public GremlinDatabase call(GremlinDatabaseInner inner) { + return new GremlinDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).toCompletable(); + } + + @Override + public Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + DatabaseAccountsInner client = this.inner(); + return client.getSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName) + .map(new Func1() { + @Override + public SqlContainer call(SqlContainerInner inner) { + return wrapSqlContainerModel(inner); + } + }); + } + + @Override + public Observable listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.listSqlContainersAsync(resourceGroupName, accountName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SqlContainer call(SqlContainerInner inner) { + return wrapSqlContainerModel(inner); + } + }); + } + + @Override + public Completable deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName).toCompletable(); + } + + @Override + public Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + DatabaseAccountsInner client = this.inner(); + return client.getMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName) + .map(new Func1() { + @Override + public MongoDBCollection call(MongoDBCollectionInner inner) { + return wrapMongoDBCollectionModel(inner); + } + }); + } + + @Override + public Observable listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.listMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public MongoDBCollection call(MongoDBCollectionInner inner) { + return wrapMongoDBCollectionModel(inner); + } + }); + } + + @Override + public Completable deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).toCompletable(); + } + + @Override + public Observable
listTablesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listTablesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return new TableImpl(inner, manager()); + } + }); + } + + @Override + public Observable
getTableAsync(String resourceGroupName, String accountName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.getTableAsync(resourceGroupName, accountName, tableName) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return new TableImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteTableAsync(String resourceGroupName, String accountName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteTableAsync(resourceGroupName, accountName, tableName).toCompletable(); + } + + @Override + public Observable listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName) { + DatabaseAccountsInner client = this.inner(); + return client.listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CassandraTable call(CassandraTableInner inner) { + return new CassandraTableImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.getCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName) + .map(new Func1() { + @Override + public CassandraTable call(CassandraTableInner inner) { + return new CassandraTableImpl(inner, manager()); + } + }); + } + + @Override + public Observable createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + DatabaseAccountsInner client = this.inner(); + return client.createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters) + .map(new Func1() { + @Override + public CassandraTable call(CassandraTableInner inner) { + return new CassandraTableImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).toCompletable(); + } + + @Override + public Observable listCassandraKeyspacesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listCassandraKeyspacesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CassandraKeyspace call(CassandraKeyspaceInner inner) { + return new CassandraKeyspaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + DatabaseAccountsInner client = this.inner(); + return client.getCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName) + .map(new Func1() { + @Override + public CassandraKeyspace call(CassandraKeyspaceInner inner) { + return new CassandraKeyspaceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).toCompletable(); + } + + @Override + public Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + DatabaseAccountsInner client = this.inner(); + return client.getGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName) + .map(new Func1() { + @Override + public GremlinGraph call(GremlinGraphInner inner) { + return wrapGremlinGraphModel(inner); + } + }); + } + + @Override + public Observable listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.listGremlinGraphsAsync(resourceGroupName, accountName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public GremlinGraph call(GremlinGraphInner inner) { + return wrapGremlinGraphModel(inner); + } + }); + } + + @Override + public Completable deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).toCompletable(); + } + } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java index be2151184d0b..cccbcb023950 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java @@ -14,14 +14,23 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspaceCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraTableCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountPatchParameters; import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountRegenerateKeyParameters; import com.microsoft.azure.management.cosmosdb.v2015_04_08.ErrorResponseException; import com.microsoft.azure.management.cosmosdb.v2015_04_08.FailoverPolicies; import com.microsoft.azure.management.cosmosdb.v2015_04_08.FailoverPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraphCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.v2015_04_08.KeyKind; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollectionCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBDatabaseCreateUpdateParameters; import com.microsoft.azure.management.cosmosdb.v2015_04_08.RegionForOnlineOffline; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainerCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.TableCreateUpdateParameters; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -172,6 +181,222 @@ interface DatabaseAccountsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions") Observable> listMetricDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listSqlDatabases" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases") + Observable> listSqlDatabases(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getSqlDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}") + Observable> getSqlDatabase(@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.v2015_04_08.DatabaseAccounts createUpdateSqlDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}") + Observable> createUpdateSqlDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, @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.v2015_04_08.DatabaseAccounts beginCreateUpdateSqlDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}") + Observable> beginCreateUpdateSqlDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, @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.v2015_04_08.DatabaseAccounts deleteSqlDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> deleteSqlDatabase(@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.v2015_04_08.DatabaseAccounts beginDeleteSqlDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDeleteSqlDatabase(@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.v2015_04_08.DatabaseAccounts listSqlContainers" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getSqlContainer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}") + Observable> getSqlContainer(@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.v2015_04_08.DatabaseAccounts createUpdateSqlContainer" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}") + Observable> createUpdateSqlContainer(@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 SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, @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.v2015_04_08.DatabaseAccounts beginCreateUpdateSqlContainer" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}") + Observable> beginCreateUpdateSqlContainer(@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 SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, @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.v2015_04_08.DatabaseAccounts deleteSqlContainer" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}", method = "DELETE", hasBody = true) + Observable> deleteSqlContainer(@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.v2015_04_08.DatabaseAccounts beginDeleteSqlContainer" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}", method = "DELETE", hasBody = true) + Observable> beginDeleteSqlContainer(@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.v2015_04_08.DatabaseAccounts listMongoDBDatabases" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases") + Observable> listMongoDBDatabases(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getMongoDBDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}") + Observable> getMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateMongoDBDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}") + Observable> createUpdateMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateMongoDBDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}") + Observable> beginCreateUpdateMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts deleteMongoDBDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> deleteMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteMongoDBDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDeleteMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listMongoDBCollections" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getMongoDBCollection" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}") + Observable> getMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateMongoDBCollection" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}") + Observable> createUpdateMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Body MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateMongoDBCollection" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}") + Observable> beginCreateUpdateMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Body MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts deleteMongoDBCollection" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}", method = "DELETE", hasBody = true) + Observable> deleteMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteMongoDBCollection" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}", method = "DELETE", hasBody = true) + Observable> beginDeleteMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listTables" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables") + Observable> listTables(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getTable" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}") + Observable> getTable(@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.v2015_04_08.DatabaseAccounts createUpdateTable" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}") + Observable> createUpdateTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Body TableCreateUpdateParameters createUpdateTableParameters, @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.v2015_04_08.DatabaseAccounts beginCreateUpdateTable" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}") + Observable> beginCreateUpdateTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Body TableCreateUpdateParameters createUpdateTableParameters, @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.v2015_04_08.DatabaseAccounts deleteTable" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> deleteTable(@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.v2015_04_08.DatabaseAccounts beginDeleteTable" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> beginDeleteTable(@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.v2015_04_08.DatabaseAccounts listCassandraKeyspaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces") + Observable> listCassandraKeyspaces(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getCassandraKeyspace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}") + Observable> getCassandraKeyspace(@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.v2015_04_08.DatabaseAccounts createUpdateCassandraKeyspace" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}") + Observable> createUpdateCassandraKeyspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Query("api-version") String apiVersion, @Body CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, @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.v2015_04_08.DatabaseAccounts beginCreateUpdateCassandraKeyspace" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}") + Observable> beginCreateUpdateCassandraKeyspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Query("api-version") String apiVersion, @Body CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, @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.v2015_04_08.DatabaseAccounts deleteCassandraKeyspace" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}", method = "DELETE", hasBody = true) + Observable> deleteCassandraKeyspace(@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.v2015_04_08.DatabaseAccounts beginDeleteCassandraKeyspace" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}", method = "DELETE", hasBody = true) + Observable> beginDeleteCassandraKeyspace(@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.v2015_04_08.DatabaseAccounts listCassandraTables" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getCassandraTable" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}") + Observable> getCassandraTable(@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.v2015_04_08.DatabaseAccounts createUpdateCassandraTable" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}") + Observable> createUpdateCassandraTable(@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 CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, @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.v2015_04_08.DatabaseAccounts beginCreateUpdateCassandraTable" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}") + Observable> beginCreateUpdateCassandraTable(@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 CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, @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.v2015_04_08.DatabaseAccounts deleteCassandraTable" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> deleteCassandraTable(@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.v2015_04_08.DatabaseAccounts beginDeleteCassandraTable" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> beginDeleteCassandraTable(@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.v2015_04_08.DatabaseAccounts listGremlinDatabases" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases") + Observable> listGremlinDatabases(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getGremlinDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}") + Observable> getGremlinDatabase(@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.v2015_04_08.DatabaseAccounts createUpdateGremlinDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}") + Observable> createUpdateGremlinDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, @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.v2015_04_08.DatabaseAccounts beginCreateUpdateGremlinDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}") + Observable> beginCreateUpdateGremlinDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, @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.v2015_04_08.DatabaseAccounts deleteGremlinDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> deleteGremlinDatabase(@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.v2015_04_08.DatabaseAccounts beginDeleteGremlinDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDeleteGremlinDatabase(@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.v2015_04_08.DatabaseAccounts listGremlinGraphs" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getGremlinGraph" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}") + Observable> getGremlinGraph(@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.v2015_04_08.DatabaseAccounts createUpdateGremlinGraph" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}") + Observable> createUpdateGremlinGraph(@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 GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, @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.v2015_04_08.DatabaseAccounts beginCreateUpdateGremlinGraph" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}") + Observable> beginCreateUpdateGremlinGraph(@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 GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, @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.v2015_04_08.DatabaseAccounts deleteGremlinGraph" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}", method = "DELETE", hasBody = true) + Observable> deleteGremlinGraph(@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.v2015_04_08.DatabaseAccounts beginDeleteGremlinGraph" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}", method = "DELETE", hasBody = true) + Observable> beginDeleteGremlinGraph(@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); + } /** @@ -2315,7 +2540,7 @@ private ServiceResponse> listUsagesDelegate(Response listMetricDefinitions(String resourceGroupNam } /** - * Retrieves metric defintions for the given database account. + * Retrieves metric definitions for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. @@ -2342,7 +2567,7 @@ public ServiceFuture> listMetricDefinitionsAsync(Str } /** - * Retrieves metric defintions for the given database account. + * Retrieves metric definitions for the given database account. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. @@ -2359,7 +2584,7 @@ public List call(ServiceResponse> listMetricDefinitionsDe .build(response); } + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<SqlDatabaseInner> object if successful. + */ + public List listSqlDatabases(String resourceGroupName, String accountName) { + return listSqlDatabasesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSqlDatabasesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSqlDatabasesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlDatabaseInner> object + */ + public Observable> listSqlDatabasesAsync(String resourceGroupName, String accountName) { + return listSqlDatabasesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlDatabaseInner> object + */ + public Observable>> listSqlDatabasesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSqlDatabases(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSqlDatabasesDelegate(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> listSqlDatabasesDelegate(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); + } + + /** + * Gets the SQL databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlDatabaseInner object if successful. + */ + public SqlDatabaseInner getSqlDatabase(String resourceGroupName, String accountName, String databaseName) { + return getSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the SQL databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the SQL databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlDatabaseInner object + */ + public Observable getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return getSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, SqlDatabaseInner>() { + @Override + public SqlDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the SQL databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlDatabaseInner object + */ + public Observable> getSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlDatabaseDelegate(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 database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlDatabaseInner object if successful. + */ + public SqlDatabaseInner createUpdateSqlDatabase(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + return createUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + return createUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).map(new Func1, SqlDatabaseInner>() { + @Override + public SqlDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateSqlDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlDatabaseParameters); + Observable> observable = service.createUpdateSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateSqlDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlDatabaseInner object if successful. + */ + public SqlDatabaseInner beginCreateUpdateSqlDatabase(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + return beginCreateUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlDatabaseInner object + */ + public Observable beginCreateUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + return beginCreateUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).map(new Func1, SqlDatabaseInner>() { + @Override + public SqlDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlDatabaseInner object + */ + public Observable> beginCreateUpdateSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateSqlDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlDatabaseParameters); + return service.beginCreateUpdateSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateSqlDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateSqlDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateSqlDatabaseDelegate(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 database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteSqlDatabase(String resourceGroupName, String accountName, String databaseName) { + deleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return deleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteSqlDatabase(String resourceGroupName, String accountName, String databaseName) { + beginDeleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return beginDeleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteSqlDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteSqlDatabaseDelegate(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); + } + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<SqlContainerInner> object if successful. + */ + public List listSqlContainers(String resourceGroupName, String accountName, String databaseName) { + return listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlContainerInner> object + */ + public Observable> listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName) { + return listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlContainerInner> object + */ + 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."); + } + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSqlContainers(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.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); + } + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param 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 SqlContainerInner object if successful. + */ + public SqlContainerInner getSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + } + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param 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); + } + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlContainerInner object + */ + public Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, SqlContainerInner>() { + @Override + public SqlContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlContainerInner object + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.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 Name of an Azure resource group. + * @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 SqlContainerInner object if successful. + */ + public SqlContainerInner 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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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, SqlContainerInner>() { + @Override + public SqlContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateSqlContainerParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlContainerParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlContainerParameters); + Observable> observable = service.createUpdateSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.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 Name of an Azure resource group. + * @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 SqlContainerInner object if successful. + */ + public SqlContainerInner 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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 SqlContainerInner object + */ + public Observable beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).map(new Func1, SqlContainerInner>() { + @Override + public SqlContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 SqlContainerInner 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateSqlContainerParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlContainerParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlContainerParameters); + return service.beginCreateUpdateSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.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); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<MongoDBDatabaseInner> object if successful. + */ + public List listMongoDBDatabases(String resourceGroupName, String accountName) { + return listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listMongoDBDatabasesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MongoDBDatabaseInner> object + */ + public Observable> listMongoDBDatabasesAsync(String resourceGroupName, String accountName) { + return listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MongoDBDatabaseInner> object + */ + public Observable>> listMongoDBDatabasesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listMongoDBDatabases(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMongoDBDatabasesDelegate(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> listMongoDBDatabasesDelegate(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); + } + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MongoDBDatabaseInner object if successful. + */ + public MongoDBDatabaseInner getMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) { + return getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBDatabaseInner object + */ + public Observable getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, MongoDBDatabaseInner>() { + @Override + public MongoDBDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBDatabaseInner object + */ + public Observable> getMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMongoDBDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMongoDBDatabaseDelegate(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 updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MongoDBDatabaseInner object if successful. + */ + public MongoDBDatabaseInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).toBlocking().last().body(); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters), serviceCallback); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).map(new Func1, MongoDBDatabaseInner>() { + @Override + public MongoDBDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateMongoDBDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateMongoDBDatabaseParameters); + Observable> observable = service.createUpdateMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateMongoDBDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MongoDBDatabaseInner object if successful. + */ + public MongoDBDatabaseInner beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).toBlocking().single().body(); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters), serviceCallback); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBDatabaseInner object + */ + public Observable beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).map(new Func1, MongoDBDatabaseInner>() { + @Override + public MongoDBDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBDatabaseInner object + */ + public Observable> beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateMongoDBDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateMongoDBDatabaseParameters); + return service.beginCreateUpdateMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateMongoDBDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateMongoDBDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateMongoDBDatabaseDelegate(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 database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) { + deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) { + beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteMongoDBDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteMongoDBDatabaseDelegate(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); + } + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<MongoDBCollectionInner> object if successful. + */ + public List listMongoDBCollections(String resourceGroupName, String accountName, String databaseName) { + return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MongoDBCollectionInner> object + */ + public Observable> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName) { + return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MongoDBCollectionInner> object + */ + 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."); + } + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listMongoDBCollections(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.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); + } + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MongoDBCollectionInner object if successful. + */ + public MongoDBCollectionInner getMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); + } + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + } + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBCollectionInner object + */ + public Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, MongoDBCollectionInner>() { + @Override + public MongoDBCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBCollectionInner object + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MongoDBCollectionInner object if successful. + */ + public MongoDBCollectionInner 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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture 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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1, MongoDBCollectionInner>() { + @Override + public MongoDBCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateMongoDBCollectionParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateMongoDBCollectionParameters is required and cannot be null."); + } + Validator.validate(createUpdateMongoDBCollectionParameters); + Observable> observable = service.createUpdateMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MongoDBCollectionInner object if successful. + */ + public MongoDBCollectionInner 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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture 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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBCollectionInner object + */ + public Observable beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1, MongoDBCollectionInner>() { + @Override + public MongoDBCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBCollectionInner 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateMongoDBCollectionParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateMongoDBCollectionParameters is required and cannot be null."); + } + Validator.validate(createUpdateMongoDBCollectionParameters); + return service.beginCreateUpdateMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { + deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture 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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable 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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { + beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture 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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable 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 Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.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); + } + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<TableInner> object if successful. + */ + public List listTables(String resourceGroupName, String accountName) { + return listTablesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listTablesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listTablesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TableInner> object + */ + public Observable> listTablesAsync(String resourceGroupName, String accountName) { + return listTablesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TableInner> object + */ + public Observable>> listTablesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listTables(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listTablesDelegate(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> listTablesDelegate(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); + } + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param 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 TableInner object if successful. + */ + public TableInner getTable(String resourceGroupName, String accountName, String tableName) { + return getTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param 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 getTableAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTableWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable getTableAsync(String resourceGroupName, String accountName, String tableName) { + return getTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> getTableWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTableDelegate(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 Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current 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 TableInner object if successful. + */ + public TableInner createUpdateTable(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return createUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current 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 createUpdateTableAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateTableAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return createUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateTableWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateTableParameters); + Observable> observable = service.createUpdateTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), createUpdateTableParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current 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 TableInner object if successful. + */ + public TableInner beginCreateUpdateTable(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return beginCreateUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current 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 beginCreateUpdateTableAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable beginCreateUpdateTableAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return beginCreateUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> beginCreateUpdateTableWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateTableParameters); + return service.beginCreateUpdateTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), createUpdateTableParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateTableDelegate(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 Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + public void deleteTable(String resourceGroupName, String accountName, String tableName) { + deleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 deleteTableAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 deleteTableAsync(String resourceGroupName, String accountName, String tableName) { + return deleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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> deleteTableWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + public void beginDeleteTable(String resourceGroupName, String accountName, String tableName) { + beginDeleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 beginDeleteTableAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteTableAsync(String resourceGroupName, String accountName, String tableName) { + return beginDeleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteTableWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteTableDelegate(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); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<CassandraKeyspaceInner> object if successful. + */ + public List listCassandraKeyspaces(String resourceGroupName, String accountName) { + return listCassandraKeyspacesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listCassandraKeyspacesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listCassandraKeyspacesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CassandraKeyspaceInner> object + */ + public Observable> listCassandraKeyspacesAsync(String resourceGroupName, String accountName) { + return listCassandraKeyspacesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CassandraKeyspaceInner> object + */ + public Observable>> listCassandraKeyspacesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listCassandraKeyspaces(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCassandraKeyspacesDelegate(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> listCassandraKeyspacesDelegate(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); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CassandraKeyspaceInner object if successful. + */ + public CassandraKeyspaceInner getCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { + return getCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param 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 CassandraKeyspaceInner object + */ + public Observable getCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + return getCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, CassandraKeyspaceInner>() { + @Override + public CassandraKeyspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param 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 CassandraKeyspaceInner object + */ + public Observable> getCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCassandraKeyspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCassandraKeyspaceDelegate(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 keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 CassandraKeyspaceInner object if successful. + */ + public CassandraKeyspaceInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return createUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 createUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return createUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).map(new Func1, CassandraKeyspaceInner>() { + @Override + public CassandraKeyspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateCassandraKeyspaceParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraKeyspaceParameters); + Observable> observable = service.createUpdateCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), createUpdateCassandraKeyspaceParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 CassandraKeyspaceInner object if successful. + */ + public CassandraKeyspaceInner beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return beginCreateUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraKeyspaceInner object + */ + public Observable beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return beginCreateUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).map(new Func1, CassandraKeyspaceInner>() { + @Override + public CassandraKeyspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraKeyspaceInner object + */ + public Observable> beginCreateUpdateCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateCassandraKeyspaceParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraKeyspaceParameters); + return service.beginCreateUpdateCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), createUpdateCassandraKeyspaceParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateCassandraKeyspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateCassandraKeyspaceDelegate(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 keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { + deleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + public Observable deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + return deleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 + */ + public Observable> deleteCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { + beginDeleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + return beginDeleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteCassandraKeyspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteCassandraKeyspaceDelegate(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); + } + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<CassandraTableInner> object if successful. + */ + public List listCassandraTables(String resourceGroupName, String accountName, String keyspaceName) { + return listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); + } + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @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<CassandraTableInner> object + */ + public Observable> listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName) { + return listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @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<CassandraTableInner> object + */ + 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."); + } + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listCassandraTables(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.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); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 CassandraTableInner object if successful. + */ + public CassandraTableInner getCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @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); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 CassandraTableInner object + */ + public Observable getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, CassandraTableInner>() { + @Override + public CassandraTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 CassandraTableInner object + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.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 Name of an Azure resource group. + * @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 CassandraTableInner object if successful. + */ + public CassandraTableInner 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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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, CassandraTableInner>() { + @Override + public CassandraTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateCassandraTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraTableParameters); + Observable> observable = service.createUpdateCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.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 Name of an Azure resource group. + * @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 CassandraTableInner object if successful. + */ + public CassandraTableInner 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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 CassandraTableInner object + */ + public Observable beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).map(new Func1, CassandraTableInner>() { + @Override + public CassandraTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 CassandraTableInner 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateCassandraTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraTableParameters); + return service.beginCreateUpdateCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.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); + } + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<GremlinDatabaseInner> object if successful. + */ + public List listGremlinDatabases(String resourceGroupName, String accountName) { + return listGremlinDatabasesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGremlinDatabasesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listGremlinDatabasesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GremlinDatabaseInner> object + */ + public Observable> listGremlinDatabasesAsync(String resourceGroupName, String accountName) { + return listGremlinDatabasesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GremlinDatabaseInner> object + */ + public Observable>> listGremlinDatabasesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listGremlinDatabases(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGremlinDatabasesDelegate(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> listGremlinDatabasesDelegate(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); + } + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GremlinDatabaseInner object if successful. + */ + public GremlinDatabaseInner getGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { + return getGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param 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 GremlinDatabaseInner object + */ + public Observable getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return getGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, GremlinDatabaseInner>() { + @Override + public GremlinDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param 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 GremlinDatabaseInner object + */ + public Observable> getGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGremlinDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGremlinDatabaseDelegate(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 database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GremlinDatabaseInner object if successful. + */ + public GremlinDatabaseInner createUpdateGremlinDatabase(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return createUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return createUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).map(new Func1, GremlinDatabaseInner>() { + @Override + public GremlinDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateGremlinDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinDatabaseParameters); + Observable> observable = service.createUpdateGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateGremlinDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GremlinDatabaseInner object if successful. + */ + public GremlinDatabaseInner beginCreateUpdateGremlinDatabase(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return beginCreateUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinDatabaseInner object + */ + public Observable beginCreateUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return beginCreateUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).map(new Func1, GremlinDatabaseInner>() { + @Override + public GremlinDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinDatabaseInner object + */ + public Observable> beginCreateUpdateGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateGremlinDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinDatabaseParameters); + return service.beginCreateUpdateGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateGremlinDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateGremlinDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateGremlinDatabaseDelegate(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 database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { + deleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return deleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { + beginDeleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return beginDeleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteGremlinDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteGremlinDatabaseDelegate(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); + } + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<GremlinGraphInner> object if successful. + */ + public List listGremlinGraphs(String resourceGroupName, String accountName, String databaseName) { + return listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GremlinGraphInner> object + */ + public Observable> listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName) { + return listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GremlinGraphInner> object + */ + 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."); + } + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listGremlinGraphs(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.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); + } + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param 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 GremlinGraphInner object if successful. + */ + public GremlinGraphInner getGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + } + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param 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); + } + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinGraphInner object + */ + public Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, GremlinGraphInner>() { + @Override + public GremlinGraphInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinGraphInner object + */ + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.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 Name of an Azure resource group. + * @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 GremlinGraphInner object if successful. + */ + public GremlinGraphInner 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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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, GremlinGraphInner>() { + @Override + public GremlinGraphInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateGremlinGraphParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinGraphParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinGraphParameters); + Observable> observable = service.createUpdateGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.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 Name of an Azure resource group. + * @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 GremlinGraphInner object if successful. + */ + public GremlinGraphInner 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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 GremlinGraphInner object + */ + public Observable beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).map(new Func1, GremlinGraphInner>() { + @Override + public GremlinGraphInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @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 GremlinGraphInner 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (createUpdateGremlinGraphParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinGraphParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinGraphParameters); + return service.beginCreateUpdateGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.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); + } + } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesImpl.java index e5b21154941d..86ccc275852a 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesImpl.java @@ -19,14 +19,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountUsage; class DatabasesImpl extends WrapperImpl implements Databases { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - DatabasesImpl(DocumentDBManager manager) { + DatabasesImpl(CosmosDBManager manager) { super(manager.inner().databases()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesInner.java index 586b0d0c6877..b8da1c5963a8 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesInner.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesInner.java @@ -366,7 +366,7 @@ private ServiceResponse> listUsagesDelegate(Response listMetricDefinitions(String resourceGroupNam } /** - * Retrieves metric defintions for the given database. + * Retrieves metric definitions for the given database. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. @@ -395,7 +395,7 @@ public ServiceFuture> listMetricDefinitionsAsync(Str } /** - * Retrieves metric defintions for the given database. + * Retrieves metric definitions for the given database. * * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. @@ -413,7 +413,7 @@ public List call(ServiceResponse implements DatabasisDatabaseAccountMetricDefinition { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - DatabasisDatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, DocumentDBManager manager) { + DatabasisDatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricImpl.java index f29785238ed8..a2f6f4182cd0 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricImpl.java @@ -18,15 +18,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class DatabasisDatabaseAccountMetricImpl extends WrapperImpl implements DatabasisDatabaseAccountMetric { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - DatabasisDatabaseAccountMetricImpl(MetricInner inner, DocumentDBManager manager) { + DatabasisDatabaseAccountMetricImpl(MetricInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountUsageImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountUsageImpl.java index 3c1283141c68..992b9bc38146 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountUsageImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountUsageImpl.java @@ -15,15 +15,15 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class DatabasisDatabaseAccountUsageImpl extends WrapperImpl implements DatabasisDatabaseAccountUsage { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - DatabasisDatabaseAccountUsageImpl(UsageInner inner, DocumentDBManager manager) { + DatabasisDatabaseAccountUsageImpl(UsageInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseImpl.java new file mode 100644 index 000000000000..94e71b5facea --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinDatabase; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class GremlinDatabaseImpl extends WrapperImpl implements GremlinDatabase { + private final CosmosDBManager manager; + GremlinDatabaseImpl(GremlinDatabaseInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String _etag() { + return this.inner()._etag(); + } + + @Override + public String _rid() { + return this.inner()._rid(); + } + + @Override + public Object _ts() { + return this.inner()._ts(); + } + + @Override + public String gremlinDatabaseId() { + return this.inner().gremlinDatabaseId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseInner.java new file mode 100644 index 000000000000..4aafcf600525 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseInner.java @@ -0,0 +1,128 @@ +/** + * 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.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Gremlin database. + */ +@JsonFlatten +@SkipParentValidation +public class GremlinDatabaseInner extends Resource { + /** + * Name of the Cosmos DB Gremlin database. + */ + @JsonProperty(value = "properties.id", required = true) + private String gremlinDatabaseId; + + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "properties._rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "properties._ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "properties._etag") + private String _etag; + + /** + * Get name of the Cosmos DB Gremlin database. + * + * @return the gremlinDatabaseId value + */ + public String gremlinDatabaseId() { + return this.gremlinDatabaseId; + } + + /** + * Set name of the Cosmos DB Gremlin database. + * + * @param gremlinDatabaseId the gremlinDatabaseId value to set + * @return the GremlinDatabaseInner object itself. + */ + public GremlinDatabaseInner withGremlinDatabaseId(String gremlinDatabaseId) { + this.gremlinDatabaseId = gremlinDatabaseId; + return this; + } + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the GremlinDatabaseInner object itself. + */ + public GremlinDatabaseInner with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the GremlinDatabaseInner object itself. + */ + public GremlinDatabaseInner with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the GremlinDatabaseInner object itself. + */ + public GremlinDatabaseInner with_etag(String _etag) { + this._etag = _etag; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphImpl.java new file mode 100644 index 000000000000..f0868d22076b --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphImpl.java @@ -0,0 +1,192 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraph; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraphCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConflictResolutionPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.IndexingPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ContainerPartitionKey; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UniqueKeyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraphResource; +import rx.functions.Func1; + +class GremlinGraphImpl extends CreatableUpdatableImpl implements GremlinGraph, GremlinGraph.Definition, GremlinGraph.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String databaseName; + private String graphName; + private GremlinGraphCreateUpdateParameters createOrUpdateParameter; + + GremlinGraphImpl(String name, CosmosDBManager manager) { + super(name, new GremlinGraphInner()); + this.manager = manager; + // Set resource name + this.graphName = name; + // + this.createOrUpdateParameter = new GremlinGraphCreateUpdateParameters(); + } + + GremlinGraphImpl(GremlinGraphInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.graphName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.graphName = IdParsingUtils.getValueFromIdByName(inner.id(), "graphs"); + // + this.createOrUpdateParameter = new GremlinGraphCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateGremlinGraphAsync(this.resourceGroupName, this.accountName, this.databaseName, this.graphName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public GremlinGraphInner call(GremlinGraphInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateGremlinGraphAsync(this.resourceGroupName, this.accountName, this.databaseName, this.graphName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public GremlinGraphInner call(GremlinGraphInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.getGremlinGraphAsync(this.resourceGroupName, this.accountName, this.databaseName, this.graphName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new GremlinGraphCreateUpdateParameters(); + } + + @Override + public String _etag() { + return this.inner()._etag(); + } + + @Override + public String _rid() { + return this.inner()._rid(); + } + + @Override + public Object _ts() { + return this.inner()._ts(); + } + + @Override + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.inner().conflictResolutionPolicy(); + } + + @Override + public Integer defaultTtl() { + return this.inner().defaultTtl(); + } + + @Override + public String gremlinGraphId() { + return this.inner().gremlinGraphId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public IndexingPolicy indexingPolicy() { + return this.inner().indexingPolicy(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ContainerPartitionKey partitionKey() { + return this.inner().partitionKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.inner().uniqueKeyPolicy(); + } + + @Override + public GremlinGraphImpl withExistingDatabasis(String resourceGroupName, String accountName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.databaseName = databaseName; + return this; + } + + @Override + public GremlinGraphImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public GremlinGraphImpl withResource(GremlinGraphResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphInner.java new file mode 100644 index 000000000000..c237c1b3b1ce --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphInner.java @@ -0,0 +1,266 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.IndexingPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ContainerPartitionKey; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UniqueKeyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConflictResolutionPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Gremlin graph. + */ +@JsonFlatten +@SkipParentValidation +public class GremlinGraphInner extends Resource { + /** + * Name of the Cosmos DB Gremlin graph. + */ + @JsonProperty(value = "properties.id", required = true) + private String gremlinGraphId; + + /** + * The configuration of the indexing policy. By default, the indexing is + * automatic for all document paths within the graph. + */ + @JsonProperty(value = "properties.indexingPolicy") + private IndexingPolicy indexingPolicy; + + /** + * The configuration of the partition key to be used for partitioning data + * into multiple partitions. + */ + @JsonProperty(value = "properties.partitionKey") + private ContainerPartitionKey partitionKey; + + /** + * Default time to live. + */ + @JsonProperty(value = "properties.defaultTtl") + private Integer defaultTtl; + + /** + * The unique key policy configuration for specifying uniqueness + * constraints on documents in the collection in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "properties.uniqueKeyPolicy") + private UniqueKeyPolicy uniqueKeyPolicy; + + /** + * The conflict resolution policy for the graph. + */ + @JsonProperty(value = "properties.conflictResolutionPolicy") + private ConflictResolutionPolicy conflictResolutionPolicy; + + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "properties._rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "properties._ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "properties._etag") + private String _etag; + + /** + * Get name of the Cosmos DB Gremlin graph. + * + * @return the gremlinGraphId value + */ + public String gremlinGraphId() { + return this.gremlinGraphId; + } + + /** + * Set name of the Cosmos DB Gremlin graph. + * + * @param gremlinGraphId the gremlinGraphId value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withGremlinGraphId(String gremlinGraphId) { + this.gremlinGraphId = gremlinGraphId; + return this; + } + + /** + * Get the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph. + * + * @return the indexingPolicy value + */ + public IndexingPolicy indexingPolicy() { + return this.indexingPolicy; + } + + /** + * Set the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph. + * + * @param indexingPolicy the indexingPolicy value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withIndexingPolicy(IndexingPolicy indexingPolicy) { + this.indexingPolicy = indexingPolicy; + return this; + } + + /** + * Get the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @return the partitionKey value + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Set the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @param partitionKey the partitionKey value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withPartitionKey(ContainerPartitionKey partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get default time to live. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set default time to live. + * + * @param defaultTtl the defaultTtl value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeyPolicy value + */ + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.uniqueKeyPolicy; + } + + /** + * Set the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeyPolicy the uniqueKeyPolicy value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { + this.uniqueKeyPolicy = uniqueKeyPolicy; + return this; + } + + /** + * Get the conflict resolution policy for the graph. + * + * @return the conflictResolutionPolicy value + */ + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.conflictResolutionPolicy; + } + + /** + * Set the conflict resolution policy for the graph. + * + * @param conflictResolutionPolicy the conflictResolutionPolicy value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { + this.conflictResolutionPolicy = conflictResolutionPolicy; + return this; + } + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner with_etag(String _etag) { + this._etag = _etag; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionImpl.java new file mode 100644 index 000000000000..9f26a216a38f --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionImpl.java @@ -0,0 +1,160 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollectionCreateUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoIndex; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollectionResource; +import rx.functions.Func1; + +class MongoDBCollectionImpl extends CreatableUpdatableImpl implements MongoDBCollection, MongoDBCollection.Definition, MongoDBCollection.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String databaseName; + private String collectionName; + private MongoDBCollectionCreateUpdateParameters createOrUpdateParameter; + + MongoDBCollectionImpl(String name, CosmosDBManager manager) { + super(name, new MongoDBCollectionInner()); + this.manager = manager; + // Set resource name + this.collectionName = name; + // + this.createOrUpdateParameter = new MongoDBCollectionCreateUpdateParameters(); + } + + MongoDBCollectionImpl(MongoDBCollectionInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.collectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.collectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "collections"); + // + this.createOrUpdateParameter = new MongoDBCollectionCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateMongoDBCollectionAsync(this.resourceGroupName, this.accountName, this.databaseName, this.collectionName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public MongoDBCollectionInner call(MongoDBCollectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateMongoDBCollectionAsync(this.resourceGroupName, this.accountName, this.databaseName, this.collectionName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public MongoDBCollectionInner call(MongoDBCollectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.getMongoDBCollectionAsync(this.resourceGroupName, this.accountName, this.databaseName, this.collectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new MongoDBCollectionCreateUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List indexes() { + return this.inner().indexes(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String mongoDBCollectionId() { + return this.inner().mongoDBCollectionId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map shardKey() { + return this.inner().shardKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public MongoDBCollectionImpl withExistingDatabasis(String resourceGroupName, String accountName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.databaseName = databaseName; + return this; + } + + @Override + public MongoDBCollectionImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public MongoDBCollectionImpl withResource(MongoDBCollectionResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionInner.java new file mode 100644 index 000000000000..16786ea8c895 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionInner.java @@ -0,0 +1,103 @@ +/** + * 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.v2015_04_08.implementation; + +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoIndex; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB MongoDB collection. + */ +@JsonFlatten +@SkipParentValidation +public class MongoDBCollectionInner extends Resource { + /** + * Name of the Cosmos DB MongoDB collection. + */ + @JsonProperty(value = "properties.id", required = true) + private String mongoDBCollectionId; + + /** + * A key-value pair of shard keys to be applied for the request. + */ + @JsonProperty(value = "properties.shardKey") + private Map shardKey; + + /** + * List of index keys. + */ + @JsonProperty(value = "properties.indexes") + private List indexes; + + /** + * Get name of the Cosmos DB MongoDB collection. + * + * @return the mongoDBCollectionId value + */ + public String mongoDBCollectionId() { + return this.mongoDBCollectionId; + } + + /** + * Set name of the Cosmos DB MongoDB collection. + * + * @param mongoDBCollectionId the mongoDBCollectionId value to set + * @return the MongoDBCollectionInner object itself. + */ + public MongoDBCollectionInner withMongoDBCollectionId(String mongoDBCollectionId) { + this.mongoDBCollectionId = mongoDBCollectionId; + return this; + } + + /** + * Get a key-value pair of shard keys to be applied for the request. + * + * @return the shardKey value + */ + public Map shardKey() { + return this.shardKey; + } + + /** + * Set a key-value pair of shard keys to be applied for the request. + * + * @param shardKey the shardKey value to set + * @return the MongoDBCollectionInner object itself. + */ + public MongoDBCollectionInner withShardKey(Map shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get list of index keys. + * + * @return the indexes value + */ + public List indexes() { + return this.indexes; + } + + /** + * Set list of index keys. + * + * @param indexes the indexes value to set + * @return the MongoDBCollectionInner object itself. + */ + public MongoDBCollectionInner withIndexes(List indexes) { + this.indexes = indexes; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseImpl.java new file mode 100644 index 000000000000..9f96c2419956 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBDatabase; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class MongoDBDatabaseImpl extends WrapperImpl implements MongoDBDatabase { + private final CosmosDBManager manager; + MongoDBDatabaseImpl(MongoDBDatabaseInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String mongoDBDatabaseId() { + return this.inner().mongoDBDatabaseId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseInner.java new file mode 100644 index 000000000000..4f7816b864c1 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseInner.java @@ -0,0 +1,48 @@ +/** + * 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.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB MongoDB database. + */ +@JsonFlatten +@SkipParentValidation +public class MongoDBDatabaseInner extends Resource { + /** + * Name of the Cosmos DB MongoDB database. + */ + @JsonProperty(value = "properties.id", required = true) + private String mongoDBDatabaseId; + + /** + * Get name of the Cosmos DB MongoDB database. + * + * @return the mongoDBDatabaseId value + */ + public String mongoDBDatabaseId() { + return this.mongoDBDatabaseId; + } + + /** + * Set name of the Cosmos DB MongoDB database. + * + * @param mongoDBDatabaseId the mongoDBDatabaseId value to set + * @return the MongoDBDatabaseInner object itself. + */ + public MongoDBDatabaseInner withMongoDBDatabaseId(String mongoDBDatabaseId) { + this.mongoDBDatabaseId = mongoDBDatabaseId; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationImpl.java index 550c33b0418d..92705bb3a819 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationImpl.java @@ -13,14 +13,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.OperationDisplay; class OperationImpl extends WrapperImpl implements Operation { - private final DocumentDBManager manager; - OperationImpl(OperationInner inner, DocumentDBManager manager) { + private final CosmosDBManager manager; + OperationImpl(OperationInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsImpl.java index ae9786bb288b..ebcf8a99937c 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.Operation; class OperationsImpl extends WrapperImpl implements Operations { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - OperationsImpl(DocumentDBManager manager) { + OperationsImpl(CosmosDBManager manager) { super(manager.inner().operations()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsImpl.java index e753bafabd99..fd0068a47c6f 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric; class PartitionKeyRangeIdRegionsImpl extends WrapperImpl implements PartitionKeyRangeIdRegions { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - PartitionKeyRangeIdRegionsImpl(DocumentDBManager manager) { + PartitionKeyRangeIdRegionsImpl(CosmosDBManager manager) { super(manager.inner().partitionKeyRangeIdRegions()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.java index a6815041b84f..be051ff6fe02 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric; class PartitionKeyRangeIdsImpl extends WrapperImpl implements PartitionKeyRangeIds { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - PartitionKeyRangeIdsImpl(DocumentDBManager manager) { + PartitionKeyRangeIdsImpl(CosmosDBManager manager) { super(manager.inner().partitionKeyRangeIds()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricImpl.java index 790f44c15160..b0995ebe9255 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class PartitionMetricImpl extends WrapperImpl implements PartitionMetric { - private final DocumentDBManager manager; - PartitionMetricImpl(PartitionMetricInner inner, DocumentDBManager manager) { + private final CosmosDBManager manager; + PartitionMetricImpl(PartitionMetricInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricInner.java index 373dfde67526..810adeac8c5d 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricInner.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricInner.java @@ -15,7 +15,7 @@ */ public class PartitionMetricInner extends MetricInner { /** - * The parition id (GUID identifier) of the metric values. + * The partition id (GUID identifier) of the metric values. */ @JsonProperty(value = "partitionId", access = JsonProperty.Access.WRITE_ONLY) private String partitionId; @@ -27,7 +27,7 @@ public class PartitionMetricInner extends MetricInner { private String partitionKeyRangeId; /** - * Get the parition id (GUID identifier) of the metric values. + * Get the partition id (GUID identifier) of the metric values. * * @return the partitionId value */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageImpl.java index fdda8002b2e6..e984f444aea2 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageImpl.java @@ -14,14 +14,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class PartitionUsageImpl extends WrapperImpl implements PartitionUsage { - private final DocumentDBManager manager; - PartitionUsageImpl(PartitionUsageInner inner, DocumentDBManager manager) { + private final CosmosDBManager manager; + PartitionUsageImpl(PartitionUsageInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageInner.java index d10413f13287..f1f8b39f588a 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageInner.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageInner.java @@ -15,7 +15,7 @@ */ public class PartitionUsageInner extends UsageInner { /** - * The parition id (GUID identifier) of the usages. + * The partition id (GUID identifier) of the usages. */ @JsonProperty(value = "partitionId", access = JsonProperty.Access.WRITE_ONLY) private String partitionId; @@ -27,7 +27,7 @@ public class PartitionUsageInner extends UsageInner { private String partitionKeyRangeId; /** - * Get the parition id (GUID identifier) of the usages. + * Get the partition id (GUID identifier) of the usages. * * @return the partitionId value */ diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricImpl.java index 2b9e11c151f5..1b0d1c08a5c4 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; class PercentileMetricImpl extends WrapperImpl implements PercentileMetric { - private final DocumentDBManager manager; - PercentileMetricImpl(PercentileMetricInner inner, DocumentDBManager manager) { + private final CosmosDBManager manager; + PercentileMetricImpl(PercentileMetricInner inner, CosmosDBManager manager) { super(inner); this.manager = manager; } @Override - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsImpl.java index 19d0ab422673..cf82c2e6e028 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetric; class PercentileSourceTargetsImpl extends WrapperImpl implements PercentileSourceTargets { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - PercentileSourceTargetsImpl(DocumentDBManager manager) { + PercentileSourceTargetsImpl(CosmosDBManager manager) { super(manager.inner().percentileSourceTargets()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsImpl.java index 58c07391e84e..41e9fd238e5e 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetric; class PercentileTargetsImpl extends WrapperImpl implements PercentileTargets { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - PercentileTargetsImpl(DocumentDBManager manager) { + PercentileTargetsImpl(CosmosDBManager manager) { super(manager.inner().percentileTargets()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesImpl.java index c37191178553..003a11bf0f6d 100644 --- a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesImpl.java +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetric; class PercentilesImpl extends WrapperImpl implements Percentiles { - private final DocumentDBManager manager; + private final CosmosDBManager manager; - PercentilesImpl(DocumentDBManager manager) { + PercentilesImpl(CosmosDBManager manager) { super(manager.inner().percentiles()); this.manager = manager; } - public DocumentDBManager manager() { + public CosmosDBManager manager() { return this.manager; } diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerImpl.java new file mode 100644 index 000000000000..c782512855d3 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerImpl.java @@ -0,0 +1,192 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainer; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainerCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConflictResolutionPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.IndexingPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ContainerPartitionKey; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UniqueKeyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainerResource; +import rx.functions.Func1; + +class SqlContainerImpl extends CreatableUpdatableImpl implements SqlContainer, SqlContainer.Definition, SqlContainer.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String databaseName; + private String containerName; + private SqlContainerCreateUpdateParameters createOrUpdateParameter; + + SqlContainerImpl(String name, CosmosDBManager manager) { + super(name, new SqlContainerInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + this.createOrUpdateParameter = new SqlContainerCreateUpdateParameters(); + } + + SqlContainerImpl(SqlContainerInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + // + this.createOrUpdateParameter = new SqlContainerCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateSqlContainerAsync(this.resourceGroupName, this.accountName, this.databaseName, this.containerName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlContainerInner call(SqlContainerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateSqlContainerAsync(this.resourceGroupName, this.accountName, this.databaseName, this.containerName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlContainerInner call(SqlContainerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.getSqlContainerAsync(this.resourceGroupName, this.accountName, this.databaseName, this.containerName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SqlContainerCreateUpdateParameters(); + } + + @Override + public String _etag() { + return this.inner()._etag(); + } + + @Override + public String _rid() { + return this.inner()._rid(); + } + + @Override + public Object _ts() { + return this.inner()._ts(); + } + + @Override + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.inner().conflictResolutionPolicy(); + } + + @Override + public Integer defaultTtl() { + return this.inner().defaultTtl(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public IndexingPolicy indexingPolicy() { + return this.inner().indexingPolicy(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ContainerPartitionKey partitionKey() { + return this.inner().partitionKey(); + } + + @Override + public String sqlContainerId() { + return this.inner().sqlContainerId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.inner().uniqueKeyPolicy(); + } + + @Override + public SqlContainerImpl withExistingDatabasis(String resourceGroupName, String accountName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.databaseName = databaseName; + return this; + } + + @Override + public SqlContainerImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public SqlContainerImpl withResource(SqlContainerResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerInner.java new file mode 100644 index 000000000000..1d3e9f8f9300 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerInner.java @@ -0,0 +1,266 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.IndexingPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ContainerPartitionKey; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UniqueKeyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConflictResolutionPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB container. + */ +@JsonFlatten +@SkipParentValidation +public class SqlContainerInner extends Resource { + /** + * Name of the Cosmos DB SQL container. + */ + @JsonProperty(value = "properties.id", required = true) + private String sqlContainerId; + + /** + * The configuration of the indexing policy. By default, the indexing is + * automatic for all document paths within the container. + */ + @JsonProperty(value = "properties.indexingPolicy") + private IndexingPolicy indexingPolicy; + + /** + * The configuration of the partition key to be used for partitioning data + * into multiple partitions. + */ + @JsonProperty(value = "properties.partitionKey") + private ContainerPartitionKey partitionKey; + + /** + * Default time to live. + */ + @JsonProperty(value = "properties.defaultTtl") + private Integer defaultTtl; + + /** + * The unique key policy configuration for specifying uniqueness + * constraints on documents in the collection in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "properties.uniqueKeyPolicy") + private UniqueKeyPolicy uniqueKeyPolicy; + + /** + * The conflict resolution policy for the container. + */ + @JsonProperty(value = "properties.conflictResolutionPolicy") + private ConflictResolutionPolicy conflictResolutionPolicy; + + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "properties._rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "properties._ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "properties._etag") + private String _etag; + + /** + * Get name of the Cosmos DB SQL container. + * + * @return the sqlContainerId value + */ + public String sqlContainerId() { + return this.sqlContainerId; + } + + /** + * Set name of the Cosmos DB SQL container. + * + * @param sqlContainerId the sqlContainerId value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withSqlContainerId(String sqlContainerId) { + this.sqlContainerId = sqlContainerId; + return this; + } + + /** + * Get the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + * + * @return the indexingPolicy value + */ + public IndexingPolicy indexingPolicy() { + return this.indexingPolicy; + } + + /** + * Set the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + * + * @param indexingPolicy the indexingPolicy value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withIndexingPolicy(IndexingPolicy indexingPolicy) { + this.indexingPolicy = indexingPolicy; + return this; + } + + /** + * Get the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @return the partitionKey value + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Set the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @param partitionKey the partitionKey value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withPartitionKey(ContainerPartitionKey partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get default time to live. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set default time to live. + * + * @param defaultTtl the defaultTtl value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeyPolicy value + */ + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.uniqueKeyPolicy; + } + + /** + * Set the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeyPolicy the uniqueKeyPolicy value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { + this.uniqueKeyPolicy = uniqueKeyPolicy; + return this; + } + + /** + * Get the conflict resolution policy for the container. + * + * @return the conflictResolutionPolicy value + */ + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.conflictResolutionPolicy; + } + + /** + * Set the conflict resolution policy for the container. + * + * @param conflictResolutionPolicy the conflictResolutionPolicy value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { + this.conflictResolutionPolicy = conflictResolutionPolicy; + return this; + } + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner with_etag(String _etag) { + this._etag = _etag; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseImpl.java new file mode 100644 index 000000000000..b0175978d210 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseImpl.java @@ -0,0 +1,170 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabase; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabaseCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabaseResource; +import rx.functions.Func1; + +class SqlDatabaseImpl extends CreatableUpdatableImpl implements SqlDatabase, SqlDatabase.Definition, SqlDatabase.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String databaseName; + private SqlDatabaseCreateUpdateParameters createOrUpdateParameter; + + SqlDatabaseImpl(String name, CosmosDBManager manager) { + super(name, new SqlDatabaseInner()); + this.manager = manager; + // Set resource name + this.databaseName = name; + // + this.createOrUpdateParameter = new SqlDatabaseCreateUpdateParameters(); + } + + SqlDatabaseImpl(SqlDatabaseInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.databaseName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + // + this.createOrUpdateParameter = new SqlDatabaseCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateSqlDatabaseAsync(this.resourceGroupName, this.accountName, this.databaseName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlDatabaseInner call(SqlDatabaseInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateSqlDatabaseAsync(this.resourceGroupName, this.accountName, this.databaseName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlDatabaseInner call(SqlDatabaseInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SqlDatabaseCreateUpdateParameters(); + } + + @Override + public String _colls() { + return this.inner()._colls(); + } + + @Override + public String _etag() { + return this.inner()._etag(); + } + + @Override + public String _rid() { + return this.inner()._rid(); + } + + @Override + public Object _ts() { + return this.inner()._ts(); + } + + @Override + public String _users() { + return this.inner()._users(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String sqlDatabaseId() { + return this.inner().sqlDatabaseId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SqlDatabaseImpl withExistingApi(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public SqlDatabaseImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public SqlDatabaseImpl withResource(SqlDatabaseResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseInner.java new file mode 100644 index 000000000000..145ab47d32b4 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseInner.java @@ -0,0 +1,182 @@ +/** + * 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.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB SQL database. + */ +@JsonFlatten +@SkipParentValidation +public class SqlDatabaseInner extends Resource { + /** + * Name of the Cosmos DB SQL database. + */ + @JsonProperty(value = "properties.id", required = true) + private String sqlDatabaseId; + + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "properties._rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "properties._ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "properties._etag") + private String _etag; + + /** + * A system generated property that specified the addressable path of the + * collections resource. + */ + @JsonProperty(value = "properties._colls") + private String _colls; + + /** + * A system generated property that specifies the addressable path of the + * users resource. + */ + @JsonProperty(value = "properties._users") + private String _users; + + /** + * Get name of the Cosmos DB SQL database. + * + * @return the sqlDatabaseId value + */ + public String sqlDatabaseId() { + return this.sqlDatabaseId; + } + + /** + * Set name of the Cosmos DB SQL database. + * + * @param sqlDatabaseId the sqlDatabaseId value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner withSqlDatabaseId(String sqlDatabaseId) { + this.sqlDatabaseId = sqlDatabaseId; + return this; + } + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_etag(String _etag) { + this._etag = _etag; + return this; + } + + /** + * Get a system generated property that specified the addressable path of the collections resource. + * + * @return the _colls value + */ + public String _colls() { + return this._colls; + } + + /** + * Set a system generated property that specified the addressable path of the collections resource. + * + * @param _colls the _colls value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_colls(String _colls) { + this._colls = _colls; + return this; + } + + /** + * Get a system generated property that specifies the addressable path of the users resource. + * + * @return the _users value + */ + public String _users() { + return this._users; + } + + /** + * Set a system generated property that specifies the addressable path of the users resource. + * + * @param _users the _users value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_users(String _users) { + this._users = _users; + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableImpl.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableImpl.java new file mode 100644 index 000000000000..68d3cf4f1bcd --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableImpl.java @@ -0,0 +1,145 @@ +/** + * 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.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Table; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.TableCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.TableResource; +import rx.functions.Func1; + +class TableImpl extends CreatableUpdatableImpl implements Table, Table.Definition, Table.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String tableName; + private TableCreateUpdateParameters createOrUpdateParameter; + + TableImpl(String name, CosmosDBManager manager) { + super(name, new TableInner()); + this.manager = manager; + // Set resource name + this.tableName = name; + // + this.createOrUpdateParameter = new TableCreateUpdateParameters(); + } + + TableImpl(TableInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.tableName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.tableName = IdParsingUtils.getValueFromIdByName(inner.id(), "tables"); + // + this.createOrUpdateParameter = new TableCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable
createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateTableAsync(this.resourceGroupName, this.accountName, this.tableName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public TableInner call(TableInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable
updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateTableAsync(this.resourceGroupName, this.accountName, this.tableName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public TableInner call(TableInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new TableCreateUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String tableId() { + return this.inner().tableId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TableImpl withExistingApi(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public TableImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public TableImpl withResource(TableResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableInner.java b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableInner.java new file mode 100644 index 000000000000..c3415273dea0 --- /dev/null +++ b/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableInner.java @@ -0,0 +1,48 @@ +/** + * 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.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Table. + */ +@JsonFlatten +@SkipParentValidation +public class TableInner extends Resource { + /** + * Name of the Cosmos DB table. + */ + @JsonProperty(value = "properties.id", required = true) + private String tableId; + + /** + * Get name of the Cosmos DB table. + * + * @return the tableId value + */ + public String tableId() { + return this.tableId; + } + + /** + * Set name of the Cosmos DB table. + * + * @param tableId the tableId value to set + * @return the TableInner object itself. + */ + public TableInner withTableId(String tableId) { + this.tableId = tableId; + return this; + } + +}