diff --git a/cosmos-db/resource-manager/v2015_04_08/pom.xml b/cosmos-db/resource-manager/v2015_04_08/pom.xml
new file mode 100644
index 0000000000000..af83e8984e8f8
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/pom.xml
@@ -0,0 +1,133 @@
+
+
+ 4.0.0
+ com.microsoft.azure.cosmos-db.v2015_04_08
+
+ com.microsoft.azure
+ azure-arm-parent
+ 0.0.2-beta
+ ../../../pom.xml
+
+ azure-mgmt-documentdb
+ 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
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+ scm:git:https://github.com/Azure/azure-libraries-for-java
+ scm:git:git@github.com:Azure/azure-libraries-for-java.git
+ HEAD
+
+
+ UTF-8
+
+
+
+
+ microsoft
+ Microsoft
+
+
+
+
+ com.microsoft.azure
+ azure-client-runtime
+
+
+ com.microsoft.azure
+ azure-arm-client-runtime
+
+
+ junit
+ junit
+ test
+
+
+ com.microsoft.azure
+ azure-client-authentication
+ test
+
+
+ com.microsoft.azure
+ azure-mgmt-resources
+ test
+
+
+ com.microsoft.azure
+ azure-arm-client-runtime
+ test-jar
+ test
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ true
+ true
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+
+ 1.7
+
+
+ com.microsoft.azure.management.apigeneration.LangDefinitionProcessor
+
+
+ true
+ true
+
+ true
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.8
+
+ *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search
+
+
+ /**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+ ]]>
+
+
+
+
+
+
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Capability.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Capability.java
new file mode 100644
index 0000000000000..5f48b1e6fd22a
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Capability.java
@@ -0,0 +1,45 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Cosmos DB capability object.
+ */
+public class Capability {
+ /**
+ * Name of the Cosmos DB capability. For example, "name":
+ * "EnableCassandra". Current values also include "EnableTable" and
+ * "EnableGremlin".
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /**
+ * Get name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin".
+ *
+ * @return the name value
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin".
+ *
+ * @param name the name value to set
+ * @return the Capability object itself.
+ */
+ public Capability withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java
new file mode 100644
index 0000000000000..897d666368646
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java
@@ -0,0 +1,52 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.MetricInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import org.joda.time.DateTime;
+import java.util.List;
+
+/**
+ * Type representing CollectionDatabasisDatabaseAccountMetric.
+ */
+public interface CollectionDatabasisDatabaseAccountMetric extends HasInner, HasManager {
+ /**
+ * @return the endTime value.
+ */
+ DateTime endTime();
+
+ /**
+ * @return the metricValues value.
+ */
+ List metricValues();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the startTime value.
+ */
+ DateTime startTime();
+
+ /**
+ * @return the timeGrain value.
+ */
+ String timeGrain();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java
new file mode 100644
index 0000000000000..916f43af31a76
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.MetricDefinitionInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import java.util.List;
+
+/**
+ * Type representing CollectionDatabasisDatabaseAccountMetricDefinition.
+ */
+public interface CollectionDatabasisDatabaseAccountMetricDefinition extends HasInner, HasManager {
+ /**
+ * @return the metricAvailabilities value.
+ */
+ List metricAvailabilities();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the primaryAggregationType value.
+ */
+ PrimaryAggregationType primaryAggregationType();
+
+ /**
+ * @return the resourceUri value.
+ */
+ String resourceUri();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java
new file mode 100644
index 0000000000000..66b46cea67de6
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java
@@ -0,0 +1,52 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.MetricInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import org.joda.time.DateTime;
+import java.util.List;
+
+/**
+ * Type representing CollectionDatabasisDatabaseAccountMetricModel.
+ */
+public interface CollectionDatabasisDatabaseAccountMetricModel extends HasInner, HasManager {
+ /**
+ * @return the endTime value.
+ */
+ DateTime endTime();
+
+ /**
+ * @return the metricValues value.
+ */
+ List metricValues();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the startTime value.
+ */
+ DateTime startTime();
+
+ /**
+ * @return the timeGrain value.
+ */
+ String timeGrain();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java
new file mode 100644
index 0000000000000..6ea9b10609d5a
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java
@@ -0,0 +1,45 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.UsageInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+
+/**
+ * Type representing CollectionDatabasisDatabaseAccountUsage.
+ */
+public interface CollectionDatabasisDatabaseAccountUsage extends HasInner, HasManager {
+ /**
+ * @return the currentValue value.
+ */
+ Integer currentValue();
+
+ /**
+ * @return the limit value.
+ */
+ Integer limit();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the quotaPeriod value.
+ */
+ String quotaPeriod();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionPartitionRegions.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionPartitionRegions.java
new file mode 100644
index 0000000000000..5bc5d8fd826d3
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionPartitionRegions.java
@@ -0,0 +1,31 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+
+/**
+ * Type representing CollectionPartitionRegions.
+ */
+public interface CollectionPartitionRegions {
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection and region, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionPartitions.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionPartitions.java
new file mode 100644
index 0000000000000..44d0161e5a2bc
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionPartitions.java
@@ -0,0 +1,42 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+
+/**
+ * Type representing CollectionPartitions.
+ */
+public interface CollectionPartitions {
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter);
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionRegions.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionRegions.java
new file mode 100644
index 0000000000000..d23bb83443c48
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/CollectionRegions.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountMetricModel;
+
+/**
+ * Type representing CollectionRegions.
+ */
+public interface CollectionRegions {
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account, collection and region.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Collections.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Collections.java
new file mode 100644
index 0000000000000..99c1dbfbce823
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Collections.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.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountMetricDefinition;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountMetric;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountUsage;
+
+/**
+ * Type representing Collections.
+ */
+public interface Collections {
+ /**
+ * Retrieves metric defintions for the given collection.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid);
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account and collection.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter);
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ConsistencyPolicy.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ConsistencyPolicy.java
new file mode 100644
index 0000000000000..223cfa194564d
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ConsistencyPolicy.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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The consistency policy for the Cosmos DB database account.
+ */
+public class ConsistencyPolicy {
+ /**
+ * The default consistency level and configuration settings of the Cosmos
+ * DB account. Possible values include: 'Eventual', 'Session',
+ * 'BoundedStaleness', 'Strong', 'ConsistentPrefix'.
+ */
+ @JsonProperty(value = "defaultConsistencyLevel", required = true)
+ private DefaultConsistencyLevel defaultConsistencyLevel;
+
+ /**
+ * When used with the Bounded Staleness consistency level, this value
+ * represents the number of stale requests tolerated. Accepted range for
+ * this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy
+ * is set to 'BoundedStaleness'.
+ */
+ @JsonProperty(value = "maxStalenessPrefix")
+ private Long maxStalenessPrefix;
+
+ /**
+ * When used with the Bounded Staleness consistency level, this value
+ * represents the time amount of staleness (in seconds) tolerated. Accepted
+ * range for this value is 5 - 86400. Required when
+ * defaultConsistencyPolicy is set to 'BoundedStaleness'.
+ */
+ @JsonProperty(value = "maxIntervalInSeconds")
+ private Integer maxIntervalInSeconds;
+
+ /**
+ * Get the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'.
+ *
+ * @return the defaultConsistencyLevel value
+ */
+ public DefaultConsistencyLevel defaultConsistencyLevel() {
+ return this.defaultConsistencyLevel;
+ }
+
+ /**
+ * Set the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'.
+ *
+ * @param defaultConsistencyLevel the defaultConsistencyLevel value to set
+ * @return the ConsistencyPolicy object itself.
+ */
+ public ConsistencyPolicy withDefaultConsistencyLevel(DefaultConsistencyLevel defaultConsistencyLevel) {
+ this.defaultConsistencyLevel = defaultConsistencyLevel;
+ return this;
+ }
+
+ /**
+ * Get when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
+ *
+ * @return the maxStalenessPrefix value
+ */
+ public Long maxStalenessPrefix() {
+ return this.maxStalenessPrefix;
+ }
+
+ /**
+ * Set when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
+ *
+ * @param maxStalenessPrefix the maxStalenessPrefix value to set
+ * @return the ConsistencyPolicy object itself.
+ */
+ public ConsistencyPolicy withMaxStalenessPrefix(Long maxStalenessPrefix) {
+ this.maxStalenessPrefix = maxStalenessPrefix;
+ return this;
+ }
+
+ /**
+ * Get when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
+ *
+ * @return the maxIntervalInSeconds value
+ */
+ public Integer maxIntervalInSeconds() {
+ return this.maxIntervalInSeconds;
+ }
+
+ /**
+ * Set when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
+ *
+ * @param maxIntervalInSeconds the maxIntervalInSeconds value to set
+ * @return the ConsistencyPolicy object itself.
+ */
+ public ConsistencyPolicy withMaxIntervalInSeconds(Integer maxIntervalInSeconds) {
+ this.maxIntervalInSeconds = maxIntervalInSeconds;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccount.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccount.java
new file mode 100644
index 0000000000000..532bd64416cc1
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccount.java
@@ -0,0 +1,234 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.Resource;
+import com.microsoft.azure.arm.resources.models.GroupableResourceCore;
+import com.microsoft.azure.arm.resources.models.HasResourceGroup;
+import com.microsoft.azure.arm.model.Refreshable;
+import com.microsoft.azure.arm.model.Updatable;
+import com.microsoft.azure.arm.model.Appliable;
+import com.microsoft.azure.arm.model.Creatable;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import java.util.List;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DatabaseAccountInner;
+
+/**
+ * Type representing DatabaseAccount.
+ */
+public interface DatabaseAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager {
+ /**
+ * @return the capabilities value.
+ */
+ List capabilities();
+
+ /**
+ * @return the consistencyPolicy value.
+ */
+ ConsistencyPolicy consistencyPolicy();
+
+ /**
+ * @return the databaseAccountOfferType value.
+ */
+ DatabaseAccountOfferType databaseAccountOfferType();
+
+ /**
+ * @return the documentEndpoint value.
+ */
+ String documentEndpoint();
+
+ /**
+ * @return the enableAutomaticFailover value.
+ */
+ Boolean enableAutomaticFailover();
+
+ /**
+ * @return the failoverPolicies value.
+ */
+ List failoverPolicies();
+
+ /**
+ * @return the ipRangeFilter value.
+ */
+ String ipRangeFilter();
+
+ /**
+ * @return the isVirtualNetworkFilterEnabled value.
+ */
+ Boolean isVirtualNetworkFilterEnabled();
+
+ /**
+ * @return the kind value.
+ */
+ DatabaseAccountKind kind();
+
+ /**
+ * @return the provisioningState value.
+ */
+ String provisioningState();
+
+ /**
+ * @return the readLocations value.
+ */
+ List readLocations();
+
+ /**
+ * @return the virtualNetworkRules value.
+ */
+ List virtualNetworkRules();
+
+ /**
+ * @return the writeLocations value.
+ */
+ List writeLocations();
+
+ /**
+ * The entirety of the DatabaseAccount definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithDatabaseAccountOfferType, DefinitionStages.WithLocations, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * Grouping of DatabaseAccount definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of a DatabaseAccount definition.
+ */
+ interface Blank extends GroupableResourceCore.DefinitionWithRegion {
+ }
+
+ /**
+ * The stage of the DatabaseAccount definition allowing to specify the resource group.
+ */
+ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup {
+ }
+
+ /**
+ * The stage of the databaseaccount definition allowing to specify DatabaseAccountOfferType.
+ */
+ interface WithDatabaseAccountOfferType {
+ /**
+ * Specifies databaseAccountOfferType.
+ */
+ WithLocations withDatabaseAccountOfferType(String databaseAccountOfferType);
+ }
+
+ /**
+ * The stage of the databaseaccount definition allowing to specify Locations.
+ */
+ interface WithLocations {
+ /**
+ * Specifies locations.
+ */
+ WithCreate withLocations(List locations);
+ }
+
+ /**
+ * The stage of the databaseaccount update allowing to specify Capabilities.
+ */
+ interface WithCapabilities {
+ /**
+ * Specifies capabilities.
+ */
+ WithCreate withCapabilities(List capabilities);
+ }
+
+ /**
+ * The stage of the databaseaccount update allowing to specify ConsistencyPolicy.
+ */
+ interface WithConsistencyPolicy {
+ /**
+ * Specifies consistencyPolicy.
+ */
+ WithCreate withConsistencyPolicy(ConsistencyPolicy consistencyPolicy);
+ }
+
+ /**
+ * The stage of the databaseaccount update allowing to specify EnableAutomaticFailover.
+ */
+ interface WithEnableAutomaticFailover {
+ /**
+ * Specifies enableAutomaticFailover.
+ */
+ WithCreate withEnableAutomaticFailover(Boolean enableAutomaticFailover);
+ }
+
+ /**
+ * The stage of the databaseaccount update allowing to specify IpRangeFilter.
+ */
+ interface WithIpRangeFilter {
+ /**
+ * Specifies ipRangeFilter.
+ */
+ WithCreate withIpRangeFilter(String ipRangeFilter);
+ }
+
+ /**
+ * The stage of the databaseaccount update allowing to specify IsVirtualNetworkFilterEnabled.
+ */
+ interface WithIsVirtualNetworkFilterEnabled {
+ /**
+ * Specifies isVirtualNetworkFilterEnabled.
+ */
+ WithCreate withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled);
+ }
+
+ /**
+ * The stage of the databaseaccount update allowing to specify Kind.
+ */
+ interface WithKind {
+ /**
+ * Specifies kind.
+ */
+ WithCreate withKind(DatabaseAccountKind kind);
+ }
+
+ /**
+ * The stage of the databaseaccount update allowing to specify VirtualNetworkRules.
+ */
+ interface WithVirtualNetworkRules {
+ /**
+ * Specifies virtualNetworkRules.
+ */
+ WithCreate withVirtualNetworkRules(List virtualNetworkRules);
+ }
+
+ /**
+ * The stage of the definition which contains all the minimum required inputs for
+ * the resource to be created (via {@link WithCreate#create()}), but also allows
+ * for any other optional settings to be specified.
+ */
+ interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithCapabilities, DefinitionStages.WithConsistencyPolicy, DefinitionStages.WithEnableAutomaticFailover, DefinitionStages.WithIpRangeFilter, DefinitionStages.WithIsVirtualNetworkFilterEnabled, DefinitionStages.WithKind, DefinitionStages.WithVirtualNetworkRules {
+ }
+ }
+ /**
+ * The template for a DatabaseAccount update operation, containing all the settings that can be modified.
+ */
+ interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithCapabilities {
+ }
+
+ /**
+ * Grouping of DatabaseAccount update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the databaseaccount {0} allowing to specify Capabilities.
+ */
+ interface WithCapabilities {
+ /**
+ * Specifies capabilities.
+ */
+ Update withCapabilities(List capabilities);
+ }
+
+ }
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountConnectionString.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountConnectionString.java
new file mode 100644
index 0000000000000..c35cf1b75d7b6
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountConnectionString.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Connection string for the Cosmos DB account.
+ */
+public class DatabaseAccountConnectionString {
+ /**
+ * Value of the connection string.
+ */
+ @JsonProperty(value = "connectionString", access = JsonProperty.Access.WRITE_ONLY)
+ private String connectionString;
+
+ /**
+ * Description of the connection string.
+ */
+ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY)
+ private String description;
+
+ /**
+ * Get value of the connection string.
+ *
+ * @return the connectionString value
+ */
+ public String connectionString() {
+ return this.connectionString;
+ }
+
+ /**
+ * Get description of the connection string.
+ *
+ * @return the description value
+ */
+ public String description() {
+ return this.description;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountCreateUpdateParameters.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountCreateUpdateParameters.java
new file mode 100644
index 0000000000000..fe980959cf4e5
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountCreateUpdateParameters.java
@@ -0,0 +1,272 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+import com.microsoft.azure.Resource;
+
+/**
+ * Parameters to create and update Cosmos DB database accounts.
+ */
+@JsonFlatten
+public class DatabaseAccountCreateUpdateParameters extends Resource {
+ /**
+ * Indicates the type of database account. This can only be set at database
+ * account creation. Possible values include: 'GlobalDocumentDB',
+ * 'MongoDB', 'Parse'.
+ */
+ @JsonProperty(value = "kind")
+ private DatabaseAccountKind kind;
+
+ /**
+ * The consistency policy for the Cosmos DB account.
+ */
+ @JsonProperty(value = "properties.consistencyPolicy")
+ private ConsistencyPolicy consistencyPolicy;
+
+ /**
+ * An array that contains the georeplication locations enabled for the
+ * Cosmos DB account.
+ */
+ @JsonProperty(value = "properties.locations", required = true)
+ private List locations;
+
+ /**
+ * The databaseAccountOfferType property.
+ */
+ @JsonProperty(value = "properties.databaseAccountOfferType", required = true)
+ private String databaseAccountOfferType;
+
+ /**
+ * 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.
+ */
+ @JsonProperty(value = "properties.ipRangeFilter")
+ private String ipRangeFilter;
+
+ /**
+ * Flag to indicate whether to enable/disable Virtual Network ACL rules.
+ */
+ @JsonProperty(value = "properties.isVirtualNetworkFilterEnabled")
+ private Boolean isVirtualNetworkFilterEnabled;
+
+ /**
+ * 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.
+ */
+ @JsonProperty(value = "properties.enableAutomaticFailover")
+ private Boolean enableAutomaticFailover;
+
+ /**
+ * List of Cosmos DB capabilities for the account.
+ */
+ @JsonProperty(value = "properties.capabilities")
+ private List capabilities;
+
+ /**
+ * List of Virtual Network ACL rules configured for the Cosmos DB account.
+ */
+ @JsonProperty(value = "properties.virtualNetworkRules")
+ private List virtualNetworkRules;
+
+ /**
+ * Creates an instance of DatabaseAccountCreateUpdateParameters class.
+ * @param locations an array that contains the georeplication locations enabled for the Cosmos DB account.
+ */
+ public DatabaseAccountCreateUpdateParameters() {
+ databaseAccountOfferType = "Standard";
+ }
+
+ /**
+ * Get indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'.
+ *
+ * @return the kind value
+ */
+ public DatabaseAccountKind kind() {
+ return this.kind;
+ }
+
+ /**
+ * Set indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'.
+ *
+ * @param kind the kind value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withKind(DatabaseAccountKind kind) {
+ this.kind = kind;
+ return this;
+ }
+
+ /**
+ * Get the consistency policy for the Cosmos DB account.
+ *
+ * @return the consistencyPolicy value
+ */
+ public ConsistencyPolicy consistencyPolicy() {
+ return this.consistencyPolicy;
+ }
+
+ /**
+ * Set the consistency policy for the Cosmos DB account.
+ *
+ * @param consistencyPolicy the consistencyPolicy value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withConsistencyPolicy(ConsistencyPolicy consistencyPolicy) {
+ this.consistencyPolicy = consistencyPolicy;
+ return this;
+ }
+
+ /**
+ * Get an array that contains the georeplication locations enabled for the Cosmos DB account.
+ *
+ * @return the locations value
+ */
+ public List locations() {
+ return this.locations;
+ }
+
+ /**
+ * Set an array that contains the georeplication locations enabled for the Cosmos DB account.
+ *
+ * @param locations the locations value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withLocations(List locations) {
+ this.locations = locations;
+ return this;
+ }
+
+ /**
+ * Get the databaseAccountOfferType value.
+ *
+ * @return the databaseAccountOfferType value
+ */
+ public String databaseAccountOfferType() {
+ return this.databaseAccountOfferType;
+ }
+
+ /**
+ * Set the databaseAccountOfferType value.
+ *
+ * @param databaseAccountOfferType the databaseAccountOfferType value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withDatabaseAccountOfferType(String databaseAccountOfferType) {
+ this.databaseAccountOfferType = databaseAccountOfferType;
+ return this;
+ }
+
+ /**
+ * Get 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 ipRangeFilter value
+ */
+ public String ipRangeFilter() {
+ return this.ipRangeFilter;
+ }
+
+ /**
+ * Set 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.
+ *
+ * @param ipRangeFilter the ipRangeFilter value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withIpRangeFilter(String ipRangeFilter) {
+ this.ipRangeFilter = ipRangeFilter;
+ return this;
+ }
+
+ /**
+ * Get flag to indicate whether to enable/disable Virtual Network ACL rules.
+ *
+ * @return the isVirtualNetworkFilterEnabled value
+ */
+ public Boolean isVirtualNetworkFilterEnabled() {
+ return this.isVirtualNetworkFilterEnabled;
+ }
+
+ /**
+ * Set flag to indicate whether to enable/disable Virtual Network ACL rules.
+ *
+ * @param isVirtualNetworkFilterEnabled the isVirtualNetworkFilterEnabled value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled) {
+ this.isVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled;
+ return this;
+ }
+
+ /**
+ * Get 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 enableAutomaticFailover value
+ */
+ public Boolean enableAutomaticFailover() {
+ return this.enableAutomaticFailover;
+ }
+
+ /**
+ * Set 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.
+ *
+ * @param enableAutomaticFailover the enableAutomaticFailover value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withEnableAutomaticFailover(Boolean enableAutomaticFailover) {
+ this.enableAutomaticFailover = enableAutomaticFailover;
+ return this;
+ }
+
+ /**
+ * Get list of Cosmos DB capabilities for the account.
+ *
+ * @return the capabilities value
+ */
+ public List capabilities() {
+ return this.capabilities;
+ }
+
+ /**
+ * Set list of Cosmos DB capabilities for the account.
+ *
+ * @param capabilities the capabilities value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withCapabilities(List capabilities) {
+ this.capabilities = capabilities;
+ return this;
+ }
+
+ /**
+ * Get list of Virtual Network ACL rules configured for the Cosmos DB account.
+ *
+ * @return the virtualNetworkRules value
+ */
+ public List virtualNetworkRules() {
+ return this.virtualNetworkRules;
+ }
+
+ /**
+ * Set list of Virtual Network ACL rules configured for the Cosmos DB account.
+ *
+ * @param virtualNetworkRules the virtualNetworkRules value to set
+ * @return the DatabaseAccountCreateUpdateParameters object itself.
+ */
+ public DatabaseAccountCreateUpdateParameters withVirtualNetworkRules(List virtualNetworkRules) {
+ this.virtualNetworkRules = virtualNetworkRules;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountKind.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountKind.java
new file mode 100644
index 0000000000000..001f40c9e6365
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountKind.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.cosmos-db.v2015_04_08;
+
+import java.util.Collection;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.microsoft.rest.ExpandableStringEnum;
+
+/**
+ * Defines values for DatabaseAccountKind.
+ */
+public final class DatabaseAccountKind extends ExpandableStringEnum {
+ /** Static value GlobalDocumentDB for DatabaseAccountKind. */
+ public static final DatabaseAccountKind GLOBAL_DOCUMENT_DB = fromString("GlobalDocumentDB");
+
+ /** Static value MongoDB for DatabaseAccountKind. */
+ public static final DatabaseAccountKind MONGO_DB = fromString("MongoDB");
+
+ /** Static value Parse for DatabaseAccountKind. */
+ public static final DatabaseAccountKind PARSE = fromString("Parse");
+
+ /**
+ * Creates or finds a DatabaseAccountKind from its string representation.
+ * @param name a name to look for
+ * @return the corresponding DatabaseAccountKind
+ */
+ @JsonCreator
+ public static DatabaseAccountKind fromString(String name) {
+ return fromString(name, DatabaseAccountKind.class);
+ }
+
+ /**
+ * @return known DatabaseAccountKind values
+ */
+ public static Collection values() {
+ return values(DatabaseAccountKind.class);
+ }
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListConnectionStringsResult.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListConnectionStringsResult.java
new file mode 100644
index 0000000000000..edd328792eae8
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListConnectionStringsResult.java
@@ -0,0 +1,26 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DatabaseAccountListConnectionStringsResultInner;
+import java.util.List;
+
+/**
+ * Type representing DatabaseAccountListConnectionStringsResult.
+ */
+public interface DatabaseAccountListConnectionStringsResult extends HasInner, HasManager {
+ /**
+ * @return the connectionStrings value.
+ */
+ List connectionStrings();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListKeysResult.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListKeysResult.java
new file mode 100644
index 0000000000000..d4fb27b659ea4
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListKeysResult.java
@@ -0,0 +1,40 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DatabaseAccountListKeysResultInner;
+
+/**
+ * Type representing DatabaseAccountListKeysResult.
+ */
+public interface DatabaseAccountListKeysResult extends HasInner, HasManager {
+ /**
+ * @return the primaryMasterKey value.
+ */
+ String primaryMasterKey();
+
+ /**
+ * @return the primaryReadonlyMasterKey value.
+ */
+ String primaryReadonlyMasterKey();
+
+ /**
+ * @return the secondaryMasterKey value.
+ */
+ String secondaryMasterKey();
+
+ /**
+ * @return the secondaryReadonlyMasterKey value.
+ */
+ String secondaryReadonlyMasterKey();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java
new file mode 100644
index 0000000000000..6031fad7ee498
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java
@@ -0,0 +1,30 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DatabaseAccountListReadOnlyKeysResultInner;
+
+/**
+ * Type representing DatabaseAccountListReadOnlyKeysResult.
+ */
+public interface DatabaseAccountListReadOnlyKeysResult extends HasInner, HasManager {
+ /**
+ * @return the primaryReadonlyMasterKey value.
+ */
+ String primaryReadonlyMasterKey();
+
+ /**
+ * @return the secondaryReadonlyMasterKey value.
+ */
+ String secondaryReadonlyMasterKey();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountMetric.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountMetric.java
new file mode 100644
index 0000000000000..b8174a1392185
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountMetric.java
@@ -0,0 +1,52 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.MetricInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import org.joda.time.DateTime;
+import java.util.List;
+
+/**
+ * Type representing DatabaseAccountMetric.
+ */
+public interface DatabaseAccountMetric extends HasInner, HasManager {
+ /**
+ * @return the endTime value.
+ */
+ DateTime endTime();
+
+ /**
+ * @return the metricValues value.
+ */
+ List metricValues();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the startTime value.
+ */
+ DateTime startTime();
+
+ /**
+ * @return the timeGrain value.
+ */
+ String timeGrain();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountMetricDefinition.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountMetricDefinition.java
new file mode 100644
index 0000000000000..1c12fa0ca0b6b
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountMetricDefinition.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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.MetricDefinitionInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import java.util.List;
+
+/**
+ * Type representing DatabaseAccountMetricDefinition.
+ */
+public interface DatabaseAccountMetricDefinition extends HasInner, HasManager {
+ /**
+ * @return the metricAvailabilities value.
+ */
+ List metricAvailabilities();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the primaryAggregationType value.
+ */
+ PrimaryAggregationType primaryAggregationType();
+
+ /**
+ * @return the resourceUri value.
+ */
+ String resourceUri();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountOfferType.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountOfferType.java
new file mode 100644
index 0000000000000..b2b0b26b70c8c
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountOfferType.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for DatabaseAccountOfferType.
+ */
+public enum DatabaseAccountOfferType {
+ /** Enum value Standard. */
+ STANDARD("Standard");
+
+ /** The actual serialized value for a DatabaseAccountOfferType instance. */
+ private String value;
+
+ DatabaseAccountOfferType(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a DatabaseAccountOfferType instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed DatabaseAccountOfferType object, or null if unable to parse.
+ */
+ @JsonCreator
+ public static DatabaseAccountOfferType fromString(String value) {
+ DatabaseAccountOfferType[] items = DatabaseAccountOfferType.values();
+ for (DatabaseAccountOfferType item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountPatchParameters.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountPatchParameters.java
new file mode 100644
index 0000000000000..e2e10171c5000
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountPatchParameters.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.cosmos-db.v2015_04_08;
+
+import java.util.Map;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+
+/**
+ * Parameters for patching Azure Cosmos DB database account properties.
+ */
+@JsonFlatten
+public class DatabaseAccountPatchParameters {
+ /**
+ * The tags property.
+ */
+ @JsonProperty(value = "tags")
+ private Map tags;
+
+ /**
+ * List of Cosmos DB capabilities for the account.
+ */
+ @JsonProperty(value = "properties.capabilities")
+ private List capabilities;
+
+ /**
+ * Get the tags value.
+ *
+ * @return the tags value
+ */
+ public Map tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags value.
+ *
+ * @param tags the tags value to set
+ * @return the DatabaseAccountPatchParameters object itself.
+ */
+ public DatabaseAccountPatchParameters withTags(Map tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ /**
+ * Get list of Cosmos DB capabilities for the account.
+ *
+ * @return the capabilities value
+ */
+ public List capabilities() {
+ return this.capabilities;
+ }
+
+ /**
+ * Set list of Cosmos DB capabilities for the account.
+ *
+ * @param capabilities the capabilities value to set
+ * @return the DatabaseAccountPatchParameters object itself.
+ */
+ public DatabaseAccountPatchParameters withCapabilities(List capabilities) {
+ this.capabilities = capabilities;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountRegenerateKeyParameters.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountRegenerateKeyParameters.java
new file mode 100644
index 0000000000000..a52c3ab932ef7
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountRegenerateKeyParameters.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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Parameters to regenerate the keys within the database account.
+ */
+public class DatabaseAccountRegenerateKeyParameters {
+ /**
+ * The access key to regenerate. Possible values include: 'primary',
+ * 'secondary', 'primaryReadonly', 'secondaryReadonly'.
+ */
+ @JsonProperty(value = "keyKind", required = true)
+ private KeyKind keyKind;
+
+ /**
+ * Get the access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'.
+ *
+ * @return the keyKind value
+ */
+ public KeyKind keyKind() {
+ return this.keyKind;
+ }
+
+ /**
+ * Set the access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'.
+ *
+ * @param keyKind the keyKind value to set
+ * @return the DatabaseAccountRegenerateKeyParameters object itself.
+ */
+ public DatabaseAccountRegenerateKeyParameters withKeyKind(KeyKind keyKind) {
+ this.keyKind = keyKind;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountRegions.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountRegions.java
new file mode 100644
index 0000000000000..3d924259b5f03
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountRegions.java
@@ -0,0 +1,31 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DatabaseAccountRegionsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing DatabaseAccountRegions.
+ */
+public interface DatabaseAccountRegions extends HasInner {
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account and region.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String filter);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountUsage.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountUsage.java
new file mode 100644
index 0000000000000..29e37687b25f1
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccountUsage.java
@@ -0,0 +1,45 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.UsageInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+
+/**
+ * Type representing DatabaseAccountUsage.
+ */
+public interface DatabaseAccountUsage extends HasInner, HasManager {
+ /**
+ * @return the currentValue value.
+ */
+ Integer currentValue();
+
+ /**
+ * @return the limit value.
+ */
+ Integer limit();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the quotaPeriod value.
+ */
+ String quotaPeriod();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccounts.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccounts.java
new file mode 100644
index 0000000000000..a64a58c68d768
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabaseAccounts.java
@@ -0,0 +1,154 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.collection.SupportsCreating;
+import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup;
+import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion;
+import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup;
+import rx.Observable;
+import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup;
+import com.microsoft.azure.arm.collection.SupportsListing;
+import rx.Completable;
+import java.util.List;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DatabaseAccountsInner;
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.DatabaseAccountMetric;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.DatabaseAccountUsage;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.DatabaseAccountMetricDefinition;
+
+/**
+ * Type representing DatabaseAccounts.
+ */
+public interface DatabaseAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner {
+ /**
+ * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param failoverPolicies List of failover policies.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Completable failoverPriorityChangeAsync(String resourceGroupName, String accountName, List failoverPolicies);
+
+ /**
+ * Lists the access keys for the specified 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 listKeysAsync(String resourceGroupName, String accountName);
+
+ /**
+ * Lists the connection strings for the specified 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 listConnectionStringsAsync(String resourceGroupName, String accountName);
+
+ /**
+ * Offline the specified region for the specified Azure Cosmos DB database account.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Completable offlineRegionAsync(String resourceGroupName, String accountName, String region);
+
+ /**
+ * Online the specified region for the specified Azure Cosmos DB database account.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Completable onlineRegionAsync(String resourceGroupName, String accountName, String region);
+
+ /**
+ * Lists the read-only access keys for the specified 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 listReadOnlyKeysAsync(String resourceGroupName, String accountName);
+
+ /**
+ * Regenerates an access key for the specified Azure Cosmos DB database account.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Completable regenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind);
+
+ /**
+ * Lists the read-only access keys for the specified 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 getReadOnlyKeysAsync(String resourceGroupName, String accountName);
+
+ /**
+ * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
+ *
+ * @param accountName Cosmos DB database account name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Completable checkNameExistsAsync(String accountName);
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String filter);
+
+ /**
+ * Retrieves the usages (most recent data) for the given 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 listUsagesAsync(String resourceGroupName, String accountName);
+
+ /**
+ * Retrieves metric defintions for the given 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 listMetricDefinitionsAsync(String resourceGroupName, String accountName);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Databases.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Databases.java
new file mode 100644
index 0000000000000..6a07bd09e472a
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Databases.java
@@ -0,0 +1,54 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.DatabasisDatabaseAccountMetricDefinition;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.DatabasisDatabaseAccountMetric;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.DatabasisDatabaseAccountUsage;
+
+/**
+ * Type representing Databases.
+ */
+public interface Databases {
+ /**
+ * Retrieves metric defintions for the given database.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid);
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account and database.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String filter);
+
+ /**
+ * Retrieves the usages (most recent data) for the given database.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountMetric.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountMetric.java
new file mode 100644
index 0000000000000..ee27458356087
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountMetric.java
@@ -0,0 +1,52 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.MetricInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import org.joda.time.DateTime;
+import java.util.List;
+
+/**
+ * Type representing DatabasisDatabaseAccountMetric.
+ */
+public interface DatabasisDatabaseAccountMetric extends HasInner, HasManager {
+ /**
+ * @return the endTime value.
+ */
+ DateTime endTime();
+
+ /**
+ * @return the metricValues value.
+ */
+ List metricValues();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the startTime value.
+ */
+ DateTime startTime();
+
+ /**
+ * @return the timeGrain value.
+ */
+ String timeGrain();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java
new file mode 100644
index 0000000000000..c01ef6429652d
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.MetricDefinitionInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import java.util.List;
+
+/**
+ * Type representing DatabasisDatabaseAccountMetricDefinition.
+ */
+public interface DatabasisDatabaseAccountMetricDefinition extends HasInner, HasManager {
+ /**
+ * @return the metricAvailabilities value.
+ */
+ List metricAvailabilities();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the primaryAggregationType value.
+ */
+ PrimaryAggregationType primaryAggregationType();
+
+ /**
+ * @return the resourceUri value.
+ */
+ String resourceUri();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountUsage.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountUsage.java
new file mode 100644
index 0000000000000..5f69db1380023
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DatabasisDatabaseAccountUsage.java
@@ -0,0 +1,45 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.UsageInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+
+/**
+ * Type representing DatabasisDatabaseAccountUsage.
+ */
+public interface DatabasisDatabaseAccountUsage extends HasInner, HasManager {
+ /**
+ * @return the currentValue value.
+ */
+ Integer currentValue();
+
+ /**
+ * @return the limit value.
+ */
+ Integer limit();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the quotaPeriod value.
+ */
+ String quotaPeriod();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DefaultConsistencyLevel.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DefaultConsistencyLevel.java
new file mode 100644
index 0000000000000..7be483f437d26
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/DefaultConsistencyLevel.java
@@ -0,0 +1,62 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for DefaultConsistencyLevel.
+ */
+public enum DefaultConsistencyLevel {
+ /** Enum value Eventual. */
+ EVENTUAL("Eventual"),
+
+ /** Enum value Session. */
+ SESSION("Session"),
+
+ /** Enum value BoundedStaleness. */
+ BOUNDED_STALENESS("BoundedStaleness"),
+
+ /** Enum value Strong. */
+ STRONG("Strong"),
+
+ /** Enum value ConsistentPrefix. */
+ CONSISTENT_PREFIX("ConsistentPrefix");
+
+ /** The actual serialized value for a DefaultConsistencyLevel instance. */
+ private String value;
+
+ DefaultConsistencyLevel(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a DefaultConsistencyLevel instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed DefaultConsistencyLevel object, or null if unable to parse.
+ */
+ @JsonCreator
+ public static DefaultConsistencyLevel fromString(String value) {
+ DefaultConsistencyLevel[] items = DefaultConsistencyLevel.values();
+ for (DefaultConsistencyLevel item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ErrorResponse.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ErrorResponse.java
new file mode 100644
index 0000000000000..4d458b5422cc3
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ErrorResponse.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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Error Response.
+ */
+public class ErrorResponse {
+ /**
+ * Error code.
+ */
+ @JsonProperty(value = "code")
+ private String code;
+
+ /**
+ * Error message indicating why the operation failed.
+ */
+ @JsonProperty(value = "message")
+ private String message;
+
+ /**
+ * Get error code.
+ *
+ * @return the code value
+ */
+ public String code() {
+ return this.code;
+ }
+
+ /**
+ * Set error code.
+ *
+ * @param code the code value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withCode(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get error message indicating why the operation failed.
+ *
+ * @return the message value
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set error message indicating why the operation failed.
+ *
+ * @param message the message value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ErrorResponseException.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ErrorResponseException.java
new file mode 100644
index 0000000000000..abb3a9cb0573c
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/ErrorResponseException.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import com.microsoft.rest.RestException;
+import okhttp3.ResponseBody;
+import retrofit2.Response;
+
+/**
+ * Exception thrown for an invalid response with ErrorResponse information.
+ */
+public class ErrorResponseException extends RestException {
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param message the exception message or the response content if a message is not available
+ * @param response the HTTP response
+ */
+ public ErrorResponseException(final String message, final Response response) {
+ super(message, response);
+ }
+
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param message the exception message or the response content if a message is not available
+ * @param response the HTTP response
+ * @param body the deserialized response body
+ */
+ public ErrorResponseException(final String message, final Response response, final ErrorResponse body) {
+ super(message, response, body);
+ }
+
+ @Override
+ public ErrorResponse body() {
+ return (ErrorResponse) super.body();
+ }
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/FailoverPolicies.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/FailoverPolicies.java
new file mode 100644
index 0000000000000..9db9867ded6c9
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/FailoverPolicies.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.cosmos-db.v2015_04_08;
+
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The list of new failover policies for the failover priority change.
+ */
+public class FailoverPolicies {
+ /**
+ * List of failover policies.
+ */
+ @JsonProperty(value = "failoverPolicies", required = true)
+ private List failoverPolicies;
+
+ /**
+ * Get list of failover policies.
+ *
+ * @return the failoverPolicies value
+ */
+ public List failoverPolicies() {
+ return this.failoverPolicies;
+ }
+
+ /**
+ * Set list of failover policies.
+ *
+ * @param failoverPolicies the failoverPolicies value to set
+ * @return the FailoverPolicies object itself.
+ */
+ public FailoverPolicies withFailoverPolicies(List failoverPolicies) {
+ this.failoverPolicies = failoverPolicies;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/FailoverPolicy.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/FailoverPolicy.java
new file mode 100644
index 0000000000000..3bc62bed0c3ca
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/FailoverPolicy.java
@@ -0,0 +1,89 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The failover policy for a given region of a database account.
+ */
+public class FailoverPolicy {
+ /**
+ * The unique identifier of the region in which the database account
+ * replicates to. Example:
+ * <accountName>-<locationName>.
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /**
+ * The name of the region in which the database account exists.
+ */
+ @JsonProperty(value = "locationName")
+ private String locationName;
+
+ /**
+ * The failover priority of the region. 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.
+ */
+ @JsonProperty(value = "failoverPriority")
+ private Integer failoverPriority;
+
+ /**
+ * Get the unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>.
+ *
+ * @return the id value
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name of the region in which the database account exists.
+ *
+ * @return the locationName value
+ */
+ public String locationName() {
+ return this.locationName;
+ }
+
+ /**
+ * Set the name of the region in which the database account exists.
+ *
+ * @param locationName the locationName value to set
+ * @return the FailoverPolicy object itself.
+ */
+ public FailoverPolicy withLocationName(String locationName) {
+ this.locationName = locationName;
+ return this;
+ }
+
+ /**
+ * Get the failover priority of the region. 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.
+ *
+ * @return the failoverPriority value
+ */
+ public Integer failoverPriority() {
+ return this.failoverPriority;
+ }
+
+ /**
+ * Set the failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
+ *
+ * @param failoverPriority the failoverPriority value to set
+ * @return the FailoverPolicy object itself.
+ */
+ public FailoverPolicy withFailoverPriority(Integer failoverPriority) {
+ this.failoverPriority = failoverPriority;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/KeyKind.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/KeyKind.java
new file mode 100644
index 0000000000000..ac5ee0b351f2d
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/KeyKind.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import java.util.Collection;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.microsoft.rest.ExpandableStringEnum;
+
+/**
+ * Defines values for KeyKind.
+ */
+public final class KeyKind extends ExpandableStringEnum {
+ /** Static value primary for KeyKind. */
+ public static final KeyKind PRIMARY = fromString("primary");
+
+ /** Static value secondary for KeyKind. */
+ public static final KeyKind SECONDARY = fromString("secondary");
+
+ /** Static value primaryReadonly for KeyKind. */
+ public static final KeyKind PRIMARY_READONLY = fromString("primaryReadonly");
+
+ /** Static value secondaryReadonly for KeyKind. */
+ public static final KeyKind SECONDARY_READONLY = fromString("secondaryReadonly");
+
+ /**
+ * Creates or finds a KeyKind from its string representation.
+ * @param name a name to look for
+ * @return the corresponding KeyKind
+ */
+ @JsonCreator
+ public static KeyKind fromString(String name) {
+ return fromString(name, KeyKind.class);
+ }
+
+ /**
+ * @return known KeyKind values
+ */
+ public static Collection values() {
+ return values(KeyKind.class);
+ }
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Location.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Location.java
new file mode 100644
index 0000000000000..affa2f501b993
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Location.java
@@ -0,0 +1,130 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * A region in which the Azure Cosmos DB database account is deployed.
+ */
+public class Location {
+ /**
+ * The unique identifier of the region within the database account.
+ * Example: <accountName>-<locationName>.
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /**
+ * The name of the region.
+ */
+ @JsonProperty(value = "locationName")
+ private String locationName;
+
+ /**
+ * The connection endpoint for the specific region. Example:
+ * https://<accountName>-<locationName>.documents.azure.com:443/.
+ */
+ @JsonProperty(value = "documentEndpoint", access = JsonProperty.Access.WRITE_ONLY)
+ private String documentEndpoint;
+
+ /**
+ * The provisioningState property.
+ */
+ @JsonProperty(value = "provisioningState")
+ private String provisioningState;
+
+ /**
+ * The failover priority of the region. 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.
+ */
+ @JsonProperty(value = "failoverPriority")
+ private Integer failoverPriority;
+
+ /**
+ * Get the unique identifier of the region within the database account. Example: <accountName>-<locationName>.
+ *
+ * @return the id value
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name of the region.
+ *
+ * @return the locationName value
+ */
+ public String locationName() {
+ return this.locationName;
+ }
+
+ /**
+ * Set the name of the region.
+ *
+ * @param locationName the locationName value to set
+ * @return the Location object itself.
+ */
+ public Location withLocationName(String locationName) {
+ this.locationName = locationName;
+ return this;
+ }
+
+ /**
+ * Get the connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/.
+ *
+ * @return the documentEndpoint value
+ */
+ public String documentEndpoint() {
+ return this.documentEndpoint;
+ }
+
+ /**
+ * Get the provisioningState value.
+ *
+ * @return the provisioningState value
+ */
+ public String provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Set the provisioningState value.
+ *
+ * @param provisioningState the provisioningState value to set
+ * @return the Location object itself.
+ */
+ public Location withProvisioningState(String provisioningState) {
+ this.provisioningState = provisioningState;
+ return this;
+ }
+
+ /**
+ * Get the failover priority of the region. 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.
+ *
+ * @return the failoverPriority value
+ */
+ public Integer failoverPriority() {
+ return this.failoverPriority;
+ }
+
+ /**
+ * Set the failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
+ *
+ * @param failoverPriority the failoverPriority value to set
+ * @return the Location object itself.
+ */
+ public Location withFailoverPriority(Integer failoverPriority) {
+ this.failoverPriority = failoverPriority;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricAvailability.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricAvailability.java
new file mode 100644
index 0000000000000..e9a253a857d24
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricAvailability.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The availability of the metric.
+ */
+public class MetricAvailability {
+ /**
+ * The time grain to be used to summarize the metric values.
+ */
+ @JsonProperty(value = "timeGrain", access = JsonProperty.Access.WRITE_ONLY)
+ private String timeGrain;
+
+ /**
+ * The retention for the metric values.
+ */
+ @JsonProperty(value = "retention", access = JsonProperty.Access.WRITE_ONLY)
+ private String retention;
+
+ /**
+ * Get the time grain to be used to summarize the metric values.
+ *
+ * @return the timeGrain value
+ */
+ public String timeGrain() {
+ return this.timeGrain;
+ }
+
+ /**
+ * Get the retention for the metric values.
+ *
+ * @return the retention value
+ */
+ public String retention() {
+ return this.retention;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricName.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricName.java
new file mode 100644
index 0000000000000..f166385190dd0
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricName.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * A metric name.
+ */
+public class MetricName {
+ /**
+ * The name of the metric.
+ */
+ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
+ private String value;
+
+ /**
+ * The friendly name of the metric.
+ */
+ @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY)
+ private String localizedValue;
+
+ /**
+ * Get the name of the metric.
+ *
+ * @return the value value
+ */
+ public String value() {
+ return this.value;
+ }
+
+ /**
+ * Get the friendly name of the metric.
+ *
+ * @return the localizedValue value
+ */
+ public String localizedValue() {
+ return this.localizedValue;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricValue.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricValue.java
new file mode 100644
index 0000000000000..2ff691fe1d278
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/MetricValue.java
@@ -0,0 +1,108 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import org.joda.time.DateTime;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Represents metrics values.
+ */
+public class MetricValue {
+ /**
+ * The number of values for the metric.
+ */
+ @JsonProperty(value = "_count", access = JsonProperty.Access.WRITE_ONLY)
+ private Double _count;
+
+ /**
+ * The average value of the metric.
+ */
+ @JsonProperty(value = "average", access = JsonProperty.Access.WRITE_ONLY)
+ private Double average;
+
+ /**
+ * The max value of the metric.
+ */
+ @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY)
+ private Double maximum;
+
+ /**
+ * The min value of the metric.
+ */
+ @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY)
+ private Double minimum;
+
+ /**
+ * The metric timestamp (ISO-8601 format).
+ */
+ @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY)
+ private DateTime timestamp;
+
+ /**
+ * The total value of the metric.
+ */
+ @JsonProperty(value = "total", access = JsonProperty.Access.WRITE_ONLY)
+ private Double total;
+
+ /**
+ * Get the number of values for the metric.
+ *
+ * @return the _count value
+ */
+ public Double _count() {
+ return this._count;
+ }
+
+ /**
+ * Get the average value of the metric.
+ *
+ * @return the average value
+ */
+ public Double average() {
+ return this.average;
+ }
+
+ /**
+ * Get the max value of the metric.
+ *
+ * @return the maximum value
+ */
+ public Double maximum() {
+ return this.maximum;
+ }
+
+ /**
+ * Get the min value of the metric.
+ *
+ * @return the minimum value
+ */
+ public Double minimum() {
+ return this.minimum;
+ }
+
+ /**
+ * Get the metric timestamp (ISO-8601 format).
+ *
+ * @return the timestamp value
+ */
+ public DateTime timestamp() {
+ return this.timestamp;
+ }
+
+ /**
+ * Get the total value of the metric.
+ *
+ * @return the total value
+ */
+ public Double total() {
+ return this.total;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Operation.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Operation.java
new file mode 100644
index 0000000000000..936a76b02a13d
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Operation.java
@@ -0,0 +1,30 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.OperationInner;
+
+/**
+ * Type representing Operation.
+ */
+public interface Operation extends HasInner, HasManager {
+ /**
+ * @return the display value.
+ */
+ OperationDisplay display();
+
+ /**
+ * @return the name value.
+ */
+ String name();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/OperationDisplay.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/OperationDisplay.java
new file mode 100644
index 0000000000000..91232c0a70ba9
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/OperationDisplay.java
@@ -0,0 +1,121 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The object that represents the operation.
+ */
+public class OperationDisplay {
+ /**
+ * Service provider: Microsoft.ResourceProvider.
+ */
+ @JsonProperty(value = "Provider")
+ private String provider;
+
+ /**
+ * Resource on which the operation is performed: Profile, endpoint, etc.
+ */
+ @JsonProperty(value = "Resource")
+ private String resource;
+
+ /**
+ * Operation type: Read, write, delete, etc.
+ */
+ @JsonProperty(value = "Operation")
+ private String operation;
+
+ /**
+ * Description of operation.
+ */
+ @JsonProperty(value = "Description")
+ private String description;
+
+ /**
+ * Get service provider: Microsoft.ResourceProvider.
+ *
+ * @return the provider value
+ */
+ public String provider() {
+ return this.provider;
+ }
+
+ /**
+ * Set service provider: Microsoft.ResourceProvider.
+ *
+ * @param provider the provider value to set
+ * @return the OperationDisplay object itself.
+ */
+ public OperationDisplay withProvider(String provider) {
+ this.provider = provider;
+ return this;
+ }
+
+ /**
+ * Get resource on which the operation is performed: Profile, endpoint, etc.
+ *
+ * @return the resource value
+ */
+ public String resource() {
+ return this.resource;
+ }
+
+ /**
+ * Set resource on which the operation is performed: Profile, endpoint, etc.
+ *
+ * @param resource the resource value to set
+ * @return the OperationDisplay object itself.
+ */
+ public OperationDisplay withResource(String resource) {
+ this.resource = resource;
+ return this;
+ }
+
+ /**
+ * Get operation type: Read, write, delete, etc.
+ *
+ * @return the operation value
+ */
+ public String operation() {
+ return this.operation;
+ }
+
+ /**
+ * Set operation type: Read, write, delete, etc.
+ *
+ * @param operation the operation value to set
+ * @return the OperationDisplay object itself.
+ */
+ public OperationDisplay withOperation(String operation) {
+ this.operation = operation;
+ return this;
+ }
+
+ /**
+ * Get description of operation.
+ *
+ * @return the description value
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Set description of operation.
+ *
+ * @param description the description value to set
+ * @return the OperationDisplay object itself.
+ */
+ public OperationDisplay withDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Operations.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Operations.java
new file mode 100644
index 0000000000000..2c5b8aa7d90c8
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Operations.java
@@ -0,0 +1,27 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.OperationsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing Operations.
+ */
+public interface Operations extends HasInner {
+ /**
+ * Lists all of the available Cosmos DB Resource Provider operations.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listAsync();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionKeyRangeIdRegions.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionKeyRangeIdRegions.java
new file mode 100644
index 0000000000000..4422ca65f0c2a
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionKeyRangeIdRegions.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+
+/**
+ * Type representing PartitionKeyRangeIdRegions.
+ */
+public interface PartitionKeyRangeIdRegions {
+ /**
+ * Retrieves the metrics determined by the given filter for the given partition key range id and region.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param partitionKeyRangeId Partition Key Range Id for which to get data.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionKeyRangeIds.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionKeyRangeIds.java
new file mode 100644
index 0000000000000..29c038ee8587a
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionKeyRangeIds.java
@@ -0,0 +1,31 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+
+/**
+ * Type representing PartitionKeyRangeIds.
+ */
+public interface PartitionKeyRangeIds {
+ /**
+ * Retrieves the metrics determined by the given filter for the given partition key range id.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param partitionKeyRangeId Partition Key Range Id for which to get data.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionMetric.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionMetric.java
new file mode 100644
index 0000000000000..17d56b422f605
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionMetric.java
@@ -0,0 +1,62 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.PartitionMetricInner;
+import org.joda.time.DateTime;
+import java.util.List;
+
+/**
+ * Type representing PartitionMetric.
+ */
+public interface PartitionMetric extends HasInner, HasManager {
+ /**
+ * @return the endTime value.
+ */
+ DateTime endTime();
+
+ /**
+ * @return the metricValues value.
+ */
+ List metricValues();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the partitionId value.
+ */
+ String partitionId();
+
+ /**
+ * @return the partitionKeyRangeId value.
+ */
+ String partitionKeyRangeId();
+
+ /**
+ * @return the startTime value.
+ */
+ DateTime startTime();
+
+ /**
+ * @return the timeGrain value.
+ */
+ String timeGrain();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionUsage.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionUsage.java
new file mode 100644
index 0000000000000..f94855f5f7535
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PartitionUsage.java
@@ -0,0 +1,55 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.PartitionUsageInner;
+
+/**
+ * Type representing PartitionUsage.
+ */
+public interface PartitionUsage extends HasInner, HasManager {
+ /**
+ * @return the currentValue value.
+ */
+ Integer currentValue();
+
+ /**
+ * @return the limit value.
+ */
+ Integer limit();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the partitionId value.
+ */
+ String partitionId();
+
+ /**
+ * @return the partitionKeyRangeId value.
+ */
+ String partitionKeyRangeId();
+
+ /**
+ * @return the quotaPeriod value.
+ */
+ String quotaPeriod();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileMetric.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileMetric.java
new file mode 100644
index 0000000000000..10f7600089a6c
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileMetric.java
@@ -0,0 +1,52 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.DocumentDBManager;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.PercentileMetricInner;
+import org.joda.time.DateTime;
+import java.util.List;
+
+/**
+ * Type representing PercentileMetric.
+ */
+public interface PercentileMetric extends HasInner, HasManager {
+ /**
+ * @return the endTime value.
+ */
+ DateTime endTime();
+
+ /**
+ * @return the metricValues value.
+ */
+ List metricValues();
+
+ /**
+ * @return the name value.
+ */
+ MetricName name();
+
+ /**
+ * @return the startTime value.
+ */
+ DateTime startTime();
+
+ /**
+ * @return the timeGrain value.
+ */
+ String timeGrain();
+
+ /**
+ * @return the unit value.
+ */
+ UnitType unit();
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileMetricValue.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileMetricValue.java
new file mode 100644
index 0000000000000..1feb712dac570
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileMetricValue.java
@@ -0,0 +1,122 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Represents percentile metrics values.
+ */
+public class PercentileMetricValue extends MetricValue {
+ /**
+ * The 10th percentile value for the metric.
+ */
+ @JsonProperty(value = "P10", access = JsonProperty.Access.WRITE_ONLY)
+ private Double p10;
+
+ /**
+ * The 25th percentile value for the metric.
+ */
+ @JsonProperty(value = "P25", access = JsonProperty.Access.WRITE_ONLY)
+ private Double p25;
+
+ /**
+ * The 50th percentile value for the metric.
+ */
+ @JsonProperty(value = "P50", access = JsonProperty.Access.WRITE_ONLY)
+ private Double p50;
+
+ /**
+ * The 75th percentile value for the metric.
+ */
+ @JsonProperty(value = "P75", access = JsonProperty.Access.WRITE_ONLY)
+ private Double p75;
+
+ /**
+ * The 90th percentile value for the metric.
+ */
+ @JsonProperty(value = "P90", access = JsonProperty.Access.WRITE_ONLY)
+ private Double p90;
+
+ /**
+ * The 95th percentile value for the metric.
+ */
+ @JsonProperty(value = "P95", access = JsonProperty.Access.WRITE_ONLY)
+ private Double p95;
+
+ /**
+ * The 99th percentile value for the metric.
+ */
+ @JsonProperty(value = "P99", access = JsonProperty.Access.WRITE_ONLY)
+ private Double p99;
+
+ /**
+ * Get the 10th percentile value for the metric.
+ *
+ * @return the p10 value
+ */
+ public Double p10() {
+ return this.p10;
+ }
+
+ /**
+ * Get the 25th percentile value for the metric.
+ *
+ * @return the p25 value
+ */
+ public Double p25() {
+ return this.p25;
+ }
+
+ /**
+ * Get the 50th percentile value for the metric.
+ *
+ * @return the p50 value
+ */
+ public Double p50() {
+ return this.p50;
+ }
+
+ /**
+ * Get the 75th percentile value for the metric.
+ *
+ * @return the p75 value
+ */
+ public Double p75() {
+ return this.p75;
+ }
+
+ /**
+ * Get the 90th percentile value for the metric.
+ *
+ * @return the p90 value
+ */
+ public Double p90() {
+ return this.p90;
+ }
+
+ /**
+ * Get the 95th percentile value for the metric.
+ *
+ * @return the p95 value
+ */
+ public Double p95() {
+ return this.p95;
+ }
+
+ /**
+ * Get the 99th percentile value for the metric.
+ *
+ * @return the p99 value
+ */
+ public Double p99() {
+ return this.p99;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileSourceTargets.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileSourceTargets.java
new file mode 100644
index 0000000000000..0e4fbe900c50a
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileSourceTargets.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.PercentileSourceTargetsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing PercentileSourceTargets.
+ */
+public interface PercentileSourceTargets extends HasInner {
+ /**
+ * Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized.
+ * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileTargets.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileTargets.java
new file mode 100644
index 0000000000000..7250a44778cce
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PercentileTargets.java
@@ -0,0 +1,31 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.PercentileTargetsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing PercentileTargets.
+ */
+public interface PercentileTargets extends HasInner {
+ /**
+ * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String targetRegion, String filter);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Percentiles.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Percentiles.java
new file mode 100644
index 0000000000000..7bbdd343a086e
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/Percentiles.java
@@ -0,0 +1,30 @@
+/**
+ * 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.cosmos-db.v2015_04_08;
+
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation.PercentilesInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing Percentiles.
+ */
+public interface Percentiles extends HasInner {
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listMetricsAsync(String resourceGroupName, String accountName, String filter);
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PrimaryAggregationType.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PrimaryAggregationType.java
new file mode 100644
index 0000000000000..10fd91bbbe02c
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/PrimaryAggregationType.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.cosmos-db.v2015_04_08;
+
+import java.util.Collection;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.microsoft.rest.ExpandableStringEnum;
+
+/**
+ * Defines values for PrimaryAggregationType.
+ */
+public final class PrimaryAggregationType extends ExpandableStringEnum {
+ /** Static value None for PrimaryAggregationType. */
+ public static final PrimaryAggregationType NONE = fromString("None");
+
+ /** Static value Average for PrimaryAggregationType. */
+ public static final PrimaryAggregationType AVERAGE = fromString("Average");
+
+ /** Static value Total for PrimaryAggregationType. */
+ public static final PrimaryAggregationType TOTAL = fromString("Total");
+
+ /** Static value Minimimum for PrimaryAggregationType. */
+ public static final PrimaryAggregationType MINIMIMUM = fromString("Minimimum");
+
+ /** Static value Maximum for PrimaryAggregationType. */
+ public static final PrimaryAggregationType MAXIMUM = fromString("Maximum");
+
+ /** Static value Last for PrimaryAggregationType. */
+ public static final PrimaryAggregationType LAST = fromString("Last");
+
+ /**
+ * Creates or finds a PrimaryAggregationType from its string representation.
+ * @param name a name to look for
+ * @return the corresponding PrimaryAggregationType
+ */
+ @JsonCreator
+ public static PrimaryAggregationType fromString(String name) {
+ return fromString(name, PrimaryAggregationType.class);
+ }
+
+ /**
+ * @return known PrimaryAggregationType values
+ */
+ public static Collection values() {
+ return values(PrimaryAggregationType.class);
+ }
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/RegionForOnlineOffline.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/RegionForOnlineOffline.java
new file mode 100644
index 0000000000000..560cef1b9e603
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/RegionForOnlineOffline.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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Cosmos DB region to online or offline.
+ */
+public class RegionForOnlineOffline {
+ /**
+ * Cosmos DB region, with spaces between words and each word capitalized.
+ */
+ @JsonProperty(value = "region", required = true)
+ private String region;
+
+ /**
+ * Get cosmos DB region, with spaces between words and each word capitalized.
+ *
+ * @return the region value
+ */
+ public String region() {
+ return this.region;
+ }
+
+ /**
+ * Set cosmos DB region, with spaces between words and each word capitalized.
+ *
+ * @param region the region value to set
+ * @return the RegionForOnlineOffline object itself.
+ */
+ public RegionForOnlineOffline withRegion(String region) {
+ this.region = region;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/UnitType.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/UnitType.java
new file mode 100644
index 0000000000000..67b70827d2ecd
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/UnitType.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08;
+
+import java.util.Collection;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.microsoft.rest.ExpandableStringEnum;
+
+/**
+ * Defines values for UnitType.
+ */
+public final class UnitType extends ExpandableStringEnum {
+ /** Static value Count for UnitType. */
+ public static final UnitType COUNT = fromString("Count");
+
+ /** Static value Bytes for UnitType. */
+ public static final UnitType BYTES = fromString("Bytes");
+
+ /** Static value Seconds for UnitType. */
+ public static final UnitType SECONDS = fromString("Seconds");
+
+ /** Static value Percent for UnitType. */
+ public static final UnitType PERCENT = fromString("Percent");
+
+ /** Static value CountPerSecond for UnitType. */
+ public static final UnitType COUNT_PER_SECOND = fromString("CountPerSecond");
+
+ /** Static value BytesPerSecond for UnitType. */
+ public static final UnitType BYTES_PER_SECOND = fromString("BytesPerSecond");
+
+ /** Static value Milliseconds for UnitType. */
+ public static final UnitType MILLISECONDS = fromString("Milliseconds");
+
+ /**
+ * Creates or finds a UnitType from its string representation.
+ * @param name a name to look for
+ * @return the corresponding UnitType
+ */
+ @JsonCreator
+ public static UnitType fromString(String name) {
+ return fromString(name, UnitType.class);
+ }
+
+ /**
+ * @return known UnitType values
+ */
+ public static Collection values() {
+ return values(UnitType.class);
+ }
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/VirtualNetworkRule.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/VirtualNetworkRule.java
new file mode 100644
index 0000000000000..8a94b03a938b9
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/VirtualNetworkRule.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.cosmos-db.v2015_04_08;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Virtual Network ACL Rule object.
+ */
+public class VirtualNetworkRule {
+ /**
+ * Resource ID of a subnet, for example:
+ * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /**
+ * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
+ *
+ * @return the id value
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
+ *
+ * @param id the id value to set
+ * @return the VirtualNetworkRule object itself.
+ */
+ public VirtualNetworkRule withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java
new file mode 100644
index 0000000000000..3ef17ebf39ae7
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java
@@ -0,0 +1,60 @@
+/**
+ * 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.cosmos-db.v2015_04_08.implementation;
+
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountMetricDefinition;
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import rx.Observable;
+import java.util.List;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.MetricAvailability;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.MetricName;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.PrimaryAggregationType;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.UnitType;
+
+class CollectionDatabasisDatabaseAccountMetricDefinitionImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetricDefinition {
+ private final DocumentDBManager manager;
+
+ CollectionDatabasisDatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, DocumentDBManager manager) {
+ super(inner);
+ this.manager = manager;
+ }
+
+ @Override
+ public DocumentDBManager manager() {
+ return this.manager;
+ }
+
+
+
+ @Override
+ public List metricAvailabilities() {
+ return this.inner().metricAvailabilities();
+ }
+
+ @Override
+ public MetricName name() {
+ return this.inner().name();
+ }
+
+ @Override
+ public PrimaryAggregationType primaryAggregationType() {
+ return this.inner().primaryAggregationType();
+ }
+
+ @Override
+ public String resourceUri() {
+ return this.inner().resourceUri();
+ }
+
+ @Override
+ public UnitType unit() {
+ return this.inner().unit();
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java
new file mode 100644
index 0000000000000..96133a83ed0c7
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java
@@ -0,0 +1,65 @@
+/**
+ * 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.cosmos-db.v2015_04_08.implementation;
+
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountMetric;
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import rx.Observable;
+import org.joda.time.DateTime;
+import java.util.List;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.MetricValue;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.MetricName;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.UnitType;
+
+class CollectionDatabasisDatabaseAccountMetricImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetric {
+ private final DocumentDBManager manager;
+
+ CollectionDatabasisDatabaseAccountMetricImpl(MetricInner inner, DocumentDBManager manager) {
+ super(inner);
+ this.manager = manager;
+ }
+
+ @Override
+ public DocumentDBManager manager() {
+ return this.manager;
+ }
+
+
+
+ @Override
+ public DateTime endTime() {
+ return this.inner().endTime();
+ }
+
+ @Override
+ public List metricValues() {
+ return this.inner().metricValues();
+ }
+
+ @Override
+ public MetricName name() {
+ return this.inner().name();
+ }
+
+ @Override
+ public DateTime startTime() {
+ return this.inner().startTime();
+ }
+
+ @Override
+ public String timeGrain() {
+ return this.inner().timeGrain();
+ }
+
+ @Override
+ public UnitType unit() {
+ return this.inner().unit();
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java
new file mode 100644
index 0000000000000..1ca8dd067373f
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java
@@ -0,0 +1,65 @@
+/**
+ * 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.cosmos-db.v2015_04_08.implementation;
+
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountMetricModel;
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import rx.Observable;
+import org.joda.time.DateTime;
+import java.util.List;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.MetricValue;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.MetricName;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.UnitType;
+
+class CollectionDatabasisDatabaseAccountMetricModelImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetricModel {
+ private final DocumentDBManager manager;
+
+ CollectionDatabasisDatabaseAccountMetricModelImpl(MetricInner inner, DocumentDBManager manager) {
+ super(inner);
+ this.manager = manager;
+ }
+
+ @Override
+ public DocumentDBManager manager() {
+ return this.manager;
+ }
+
+
+
+ @Override
+ public DateTime endTime() {
+ return this.inner().endTime();
+ }
+
+ @Override
+ public List metricValues() {
+ return this.inner().metricValues();
+ }
+
+ @Override
+ public MetricName name() {
+ return this.inner().name();
+ }
+
+ @Override
+ public DateTime startTime() {
+ return this.inner().startTime();
+ }
+
+ @Override
+ public String timeGrain() {
+ return this.inner().timeGrain();
+ }
+
+ @Override
+ public UnitType unit() {
+ return this.inner().unit();
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java
new file mode 100644
index 0000000000000..5884b0e9482ae
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.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.cosmos-db.v2015_04_08.implementation;
+
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountUsage;
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import rx.Observable;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.MetricName;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.UnitType;
+
+class CollectionDatabasisDatabaseAccountUsageImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountUsage {
+ private final DocumentDBManager manager;
+
+ CollectionDatabasisDatabaseAccountUsageImpl(UsageInner inner, DocumentDBManager manager) {
+ super(inner);
+ this.manager = manager;
+ }
+
+ @Override
+ public DocumentDBManager manager() {
+ return this.manager;
+ }
+
+
+
+ @Override
+ public Integer currentValue() {
+ return this.inner().currentValue();
+ }
+
+ @Override
+ public Integer limit() {
+ return this.inner().limit();
+ }
+
+ @Override
+ public MetricName name() {
+ return this.inner().name();
+ }
+
+ @Override
+ public String quotaPeriod() {
+ return this.inner().quotaPeriod();
+ }
+
+ @Override
+ public UnitType unit() {
+ return this.inner().unit();
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java
new file mode 100644
index 0000000000000..615996fef6549
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * abc
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionPartitionRegions;
+import rx.functions.Func1;
+import rx.Observable;
+import java.util.List;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.PartitionMetric;
+
+class CollectionPartitionRegionsImpl extends WrapperImpl implements CollectionPartitionRegions {
+ private final DocumentDBManager manager;
+
+ CollectionPartitionRegionsImpl(DocumentDBManager manager) {
+ super(manager.inner().collectionPartitionRegions());
+ this.manager = manager;
+ }
+
+ public DocumentDBManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) {
+ CollectionPartitionRegionsInner client = this.inner();
+ return client.listMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter)
+ .flatMap(new Func1, Observable>() {
+ @Override
+ public Observable call(List innerList) {
+ return Observable.from(innerList);
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PartitionMetric call(PartitionMetricInner inner) {
+ return new PartitionMetricImpl(inner, manager());
+ }
+ });
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionRegionsInner.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionRegionsInner.java
new file mode 100644
index 0000000000000..dbf53351d450f
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionRegionsInner.java
@@ -0,0 +1,180 @@
+/**
+ * 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.cosmos-db.v2015_04_08.implementation;
+
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.CloudException;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.ResponseBody;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.Path;
+import retrofit2.http.Query;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in CollectionPartitionRegions.
+ */
+public class CollectionPartitionRegionsInner {
+ /** The Retrofit service to perform REST calls. */
+ private CollectionPartitionRegionsService service;
+ /** The service client containing this operation class. */
+ private CosmosDBImpl client;
+
+ /**
+ * Initializes an instance of CollectionPartitionRegionsInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public CollectionPartitionRegionsInner(Retrofit retrofit, CosmosDBImpl client) {
+ this.service = retrofit.create(CollectionPartitionRegionsService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for CollectionPartitionRegions to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface CollectionPartitionRegionsService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionPartitionRegions listMetrics" })
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics")
+ Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("region") String region, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection and region, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @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<PartitionMetricInner> object if successful.
+ */
+ public List listMetrics(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) {
+ return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).toBlocking().single().body();
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection and region, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @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> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter), serviceCallback);
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection and region, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<PartitionMetricInner> object
+ */
+ public Observable> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) {
+ return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection and region, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<PartitionMetricInner> object
+ */
+ public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) {
+ 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 (region == null) {
+ throw new IllegalArgumentException("Parameter region is required and cannot be null.");
+ }
+ if (databaseRid == null) {
+ throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null.");
+ }
+ if (collectionRid == null) {
+ throw new IllegalArgumentException("Parameter collectionRid 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 (filter == null) {
+ throw new IllegalArgumentException("Parameter filter is required and cannot be null.");
+ }
+ return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, region, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listMetricsDelegate(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> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionsImpl.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionsImpl.java
new file mode 100644
index 0000000000000..1a25f0e56903f
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionsImpl.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.
+ * abc
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionPartitions;
+import rx.functions.Func1;
+import rx.Observable;
+import java.util.List;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.PartitionMetric;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.PartitionUsage;
+
+class CollectionPartitionsImpl extends WrapperImpl implements CollectionPartitions {
+ private final DocumentDBManager manager;
+
+ CollectionPartitionsImpl(DocumentDBManager manager) {
+ super(manager.inner().collectionPartitions());
+ this.manager = manager;
+ }
+
+ public DocumentDBManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
+ CollectionPartitionsInner client = this.inner();
+ return client.listMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter)
+ .flatMap(new Func1, Observable>() {
+ @Override
+ public Observable call(List innerList) {
+ return Observable.from(innerList);
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PartitionMetric call(PartitionMetricInner inner) {
+ return new PartitionMetricImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) {
+ CollectionPartitionsInner client = this.inner();
+ return client.listUsagesAsync(resourceGroupName, accountName, databaseRid, collectionRid)
+ .flatMap(new Func1, Observable>() {
+ @Override
+ public Observable call(List innerList) {
+ return Observable.from(innerList);
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PartitionUsage call(PartitionUsageInner inner) {
+ return new PartitionUsageImpl(inner, manager());
+ }
+ });
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionsInner.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionsInner.java
new file mode 100644
index 0000000000000..5a51af2112953
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionPartitionsInner.java
@@ -0,0 +1,385 @@
+/**
+ * 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.cosmos-db.v2015_04_08.implementation;
+
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.CloudException;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.ResponseBody;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.Path;
+import retrofit2.http.Query;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in CollectionPartitions.
+ */
+public class CollectionPartitionsInner {
+ /** The Retrofit service to perform REST calls. */
+ private CollectionPartitionsService service;
+ /** The service client containing this operation class. */
+ private CosmosDBImpl client;
+
+ /**
+ * Initializes an instance of CollectionPartitionsInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public CollectionPartitionsInner(Retrofit retrofit, CosmosDBImpl client) {
+ this.service = retrofit.create(CollectionPartitionsService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for CollectionPartitions to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface CollectionPartitionsService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionPartitions listMetrics" })
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics")
+ Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmos-db.v2015_04_08.CollectionPartitions listUsages" })
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages")
+ Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @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<PartitionMetricInner> object if successful.
+ */
+ public List listMetrics(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
+ return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).toBlocking().single().body();
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @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> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), serviceCallback);
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<PartitionMetricInner> object
+ */
+ public Observable> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
+ return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<PartitionMetricInner> object
+ */
+ public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
+ 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 (databaseRid == null) {
+ throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null.");
+ }
+ if (collectionRid == null) {
+ throw new IllegalArgumentException("Parameter collectionRid 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 (filter == null) {
+ throw new IllegalArgumentException("Parameter filter is required and cannot be null.");
+ }
+ return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listMetricsDelegate(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> listMetricsDelegate(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);
+ }
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @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<PartitionUsageInner> object if successful.
+ */
+ public List listUsages(String resourceGroupName, String accountName, String databaseRid, String collectionRid) {
+ return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid).toBlocking().single().body();
+ }
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @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> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid), serviceCallback);
+ }
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<PartitionUsageInner> object
+ */
+ public Observable> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) {
+ return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid).map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<PartitionUsageInner> object
+ */
+ public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) {
+ 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 (databaseRid == null) {
+ throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null.");
+ }
+ if (collectionRid == null) {
+ throw new IllegalArgumentException("Parameter collectionRid is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ final String filter = null;
+ return service.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listUsagesDelegate(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);
+ }
+ }
+ });
+ }
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).
+ * @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<PartitionUsageInner> object if successful.
+ */
+ public List listUsages(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
+ return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).toBlocking().single().body();
+ }
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).
+ * @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> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), serviceCallback);
+ }
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<PartitionUsageInner> object
+ */
+ public Observable> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
+ return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Retrieves the usages (most recent storage data) for the given collection, split by partition.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<PartitionUsageInner> object
+ */
+ public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) {
+ 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 (databaseRid == null) {
+ throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null.");
+ }
+ if (collectionRid == null) {
+ throw new IllegalArgumentException("Parameter collectionRid 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.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listUsagesDelegate(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> listUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionRegionsImpl.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionRegionsImpl.java
new file mode 100644
index 0000000000000..6be410b043a9c
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionRegionsImpl.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.
+ * abc
+ */
+
+package com.microsoft.azure.management.cosmos-db.v2015_04_08.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionRegions;
+import rx.Observable;
+import rx.functions.Func1;
+import java.util.List;
+import com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionDatabasisDatabaseAccountMetricModel;
+
+class CollectionRegionsImpl extends WrapperImpl implements CollectionRegions {
+ private final DocumentDBManager manager;
+
+ CollectionRegionsImpl(DocumentDBManager manager) {
+ super(manager.inner().collectionRegions());
+ this.manager = manager;
+ }
+
+ public DocumentDBManager manager() {
+ return this.manager;
+ }
+
+ private CollectionDatabasisDatabaseAccountMetricModelImpl wrapCollectionDatabasisDatabaseAccountMetricModelModel(MetricInner inner) {
+ return new CollectionDatabasisDatabaseAccountMetricModelImpl(inner, manager());
+ }
+
+ @Override
+ public Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) {
+ CollectionRegionsInner client = this.inner();
+ return client.listMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter)
+ .flatMap(new Func1, Observable>() {
+ @Override
+ public Observable call(List innerList) {
+ return Observable.from(innerList);
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public CollectionDatabasisDatabaseAccountMetricModel call(MetricInner inner) {
+ return wrapCollectionDatabasisDatabaseAccountMetricModelModel(inner);
+ }
+ });
+ }
+
+}
diff --git a/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionRegionsInner.java b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionRegionsInner.java
new file mode 100644
index 0000000000000..1ee6de96ba05e
--- /dev/null
+++ b/cosmos-db/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmos-db/v2015_04_08/implementation/CollectionRegionsInner.java
@@ -0,0 +1,180 @@
+/**
+ * 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.cosmos-db.v2015_04_08.implementation;
+
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.CloudException;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.ResponseBody;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.Path;
+import retrofit2.http.Query;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in CollectionRegions.
+ */
+public class CollectionRegionsInner {
+ /** The Retrofit service to perform REST calls. */
+ private CollectionRegionsService service;
+ /** The service client containing this operation class. */
+ private CosmosDBImpl client;
+
+ /**
+ * Initializes an instance of CollectionRegionsInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public CollectionRegionsInner(Retrofit retrofit, CosmosDBImpl client) {
+ this.service = retrofit.create(CollectionRegionsService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for CollectionRegions to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface CollectionRegionsService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmos-db.v2015_04_08.CollectionRegions listMetrics" })
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics")
+ Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("region") String region, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account, collection and region.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @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<MetricInner> object if successful.
+ */
+ public List listMetrics(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) {
+ return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).toBlocking().single().body();
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account, collection and region.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @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> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter), serviceCallback);
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account, collection and region.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<MetricInner> object
+ */
+ public Observable> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) {
+ return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Retrieves the metrics determined by the given filter for the given database account, collection and region.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param accountName Cosmos DB database account name.
+ * @param region Cosmos DB region, with spaces between words and each word capitalized.
+ * @param databaseRid Cosmos DB database rid.
+ * @param collectionRid Cosmos DB collection rid.
+ * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<MetricInner> object
+ */
+ public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) {
+ 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 (region == null) {
+ throw new IllegalArgumentException("Parameter region is required and cannot be null.");
+ }
+ if (databaseRid == null) {
+ throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null.");
+ }
+ if (collectionRid == null) {
+ throw new IllegalArgumentException("Parameter collectionRid 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 (filter == null) {
+ throw new IllegalArgumentException("Parameter filter is required and cannot be null.");
+ }
+ return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, region, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1