diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs index a51b36dcfc43..636c0f243c61 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs @@ -55,7 +55,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -87,6 +87,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -125,7 +132,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -135,7 +152,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListCassandraKeyspaces", tracingParameters); } @@ -146,9 +162,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -280,7 +296,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -315,6 +331,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -357,7 +380,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "keyspaceName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -368,7 +401,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetCassandraKeyspace", tracingParameters); } @@ -380,9 +412,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -513,7 +545,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -541,7 +573,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Cassandra keyspace. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -567,7 +599,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -602,6 +634,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -644,7 +683,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "keyspaceName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -655,7 +704,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetCassandraKeyspaceThroughput", tracingParameters); } @@ -667,9 +715,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -800,7 +848,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -830,7 +878,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -865,6 +913,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -907,7 +962,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "keyspaceName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -918,7 +983,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListCassandraTables", tracingParameters); } @@ -930,9 +994,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1064,7 +1128,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1102,6 +1166,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1148,7 +1219,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1160,7 +1241,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetCassandraTable", tracingParameters); } @@ -1173,9 +1253,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1306,7 +1386,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Cassandra Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1337,7 +1417,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1366,7 +1446,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1404,6 +1484,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1450,7 +1537,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1462,7 +1559,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetCassandraTableThroughput", tracingParameters); } @@ -1475,9 +1571,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1608,7 +1704,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1640,7 +1736,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1678,6 +1774,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1720,6 +1823,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "keyspaceName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateCassandraKeyspaceParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateCassandraKeyspaceParameters"); @@ -1728,7 +1842,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { createUpdateCassandraKeyspaceParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1739,7 +1852,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateCassandraKeyspaceParameters", createUpdateCassandraKeyspaceParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateCassandraKeyspace", tracingParameters); @@ -1752,9 +1864,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1812,7 +1924,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1821,10 +1932,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -1896,7 +2003,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Cassandra keyspace. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1928,6 +2035,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1970,7 +2084,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "keyspaceName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1981,7 +2105,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteCassandraKeyspace", tracingParameters); } @@ -1993,9 +2116,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2047,7 +2170,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2056,10 +2178,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200) && !((int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2113,7 +2231,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2152,6 +2270,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2194,6 +2319,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "keyspaceName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -2202,7 +2338,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2213,7 +2348,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateCassandraKeyspaceThroughput", tracingParameters); @@ -2226,9 +2360,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2286,7 +2420,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2295,10 +2428,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2370,7 +2499,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Cassandra Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2411,6 +2540,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2457,6 +2593,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateCassandraTableParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateCassandraTableParameters"); @@ -2465,7 +2612,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { createUpdateCassandraTableParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2477,7 +2623,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateCassandraTableParameters", createUpdateCassandraTableParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateCassandraTable", tracingParameters); @@ -2491,9 +2636,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2551,7 +2696,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2560,10 +2704,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2635,7 +2775,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2670,6 +2810,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2716,7 +2863,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2728,7 +2885,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteCassandraTable", tracingParameters); } @@ -2741,9 +2897,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2795,7 +2951,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2804,10 +2959,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2861,7 +3012,7 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2903,6 +3054,13 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2949,6 +3107,17 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -2957,7 +3126,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2969,7 +3137,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateCassandraTableThroughput", tracingParameters); @@ -2983,9 +3150,9 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3043,7 +3210,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3052,10 +3218,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperationsExtensions.cs index 7479230d255d..e51876409a11 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class CassandraResourcesOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -49,7 +49,7 @@ public static IEnumerable ListCassandraKeyspaces(th /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -73,7 +73,7 @@ public static IEnumerable ListCassandraKeyspaces(th /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -94,7 +94,7 @@ public static CassandraKeyspaceGetResults GetCassandraKeyspace(this ICassandraRe /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -120,7 +120,7 @@ public static CassandraKeyspaceGetResults GetCassandraKeyspace(this ICassandraRe /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -143,7 +143,7 @@ public static CassandraKeyspaceGetResults CreateUpdateCassandraKeyspace(this ICa /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -172,7 +172,7 @@ public static CassandraKeyspaceGetResults CreateUpdateCassandraKeyspace(this ICa /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -192,7 +192,7 @@ public static void DeleteCassandraKeyspace(this ICassandraResourcesOperations op /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -216,7 +216,7 @@ public static void DeleteCassandraKeyspace(this ICassandraResourcesOperations op /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -237,7 +237,7 @@ public static ThroughputSettingsGetResults GetCassandraKeyspaceThroughput(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -263,7 +263,7 @@ public static ThroughputSettingsGetResults GetCassandraKeyspaceThroughput(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -287,7 +287,7 @@ public static ThroughputSettingsGetResults UpdateCassandraKeyspaceThroughput(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -318,7 +318,7 @@ public static ThroughputSettingsGetResults UpdateCassandraKeyspaceThroughput(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -339,7 +339,7 @@ public static IEnumerable ListCassandraTables(this ICa /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -366,7 +366,7 @@ public static IEnumerable ListCassandraTables(this ICa /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -390,7 +390,7 @@ public static CassandraTableGetResults GetCassandraTable(this ICassandraResource /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -419,7 +419,7 @@ public static CassandraTableGetResults GetCassandraTable(this ICassandraResource /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -445,7 +445,7 @@ public static CassandraTableGetResults CreateUpdateCassandraTable(this ICassandr /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -477,7 +477,7 @@ public static CassandraTableGetResults CreateUpdateCassandraTable(this ICassandr /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -500,7 +500,7 @@ public static void DeleteCassandraTable(this ICassandraResourcesOperations opera /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -527,7 +527,7 @@ public static void DeleteCassandraTable(this ICassandraResourcesOperations opera /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -551,7 +551,7 @@ public static ThroughputSettingsGetResults GetCassandraTableThroughput(this ICas /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -580,7 +580,7 @@ public static ThroughputSettingsGetResults GetCassandraTableThroughput(this ICas /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -607,7 +607,7 @@ public static ThroughputSettingsGetResults UpdateCassandraTableThroughput(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -640,7 +640,7 @@ public static ThroughputSettingsGetResults UpdateCassandraTableThroughput(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -663,7 +663,7 @@ public static CassandraKeyspaceGetResults BeginCreateUpdateCassandraKeyspace(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -692,7 +692,7 @@ public static CassandraKeyspaceGetResults BeginCreateUpdateCassandraKeyspace(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -712,7 +712,7 @@ public static void BeginDeleteCassandraKeyspace(this ICassandraResourcesOperatio /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -735,7 +735,7 @@ public static void BeginDeleteCassandraKeyspace(this ICassandraResourcesOperatio /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -759,7 +759,7 @@ public static ThroughputSettingsGetResults BeginUpdateCassandraKeyspaceThroughpu /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -789,7 +789,7 @@ public static ThroughputSettingsGetResults BeginUpdateCassandraKeyspaceThroughpu /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -815,7 +815,7 @@ public static CassandraTableGetResults BeginCreateUpdateCassandraTable(this ICas /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -847,7 +847,7 @@ public static CassandraTableGetResults BeginCreateUpdateCassandraTable(this ICas /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -870,7 +870,7 @@ public static void BeginDeleteCassandraTable(this ICassandraResourcesOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -896,7 +896,7 @@ public static void BeginDeleteCassandraTable(this ICassandraResourcesOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -923,7 +923,7 @@ public static ThroughputSettingsGetResults BeginUpdateCassandraTableThroughput(t /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperations.cs index eba6581dfb4b..9895b247cbbb 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperations.cs @@ -55,7 +55,7 @@ internal CollectionOperations(CosmosDBManagementClient client) /// account and collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -99,6 +99,13 @@ internal CollectionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -145,11 +152,21 @@ internal CollectionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionRid"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -161,7 +178,6 @@ internal CollectionOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -175,9 +191,9 @@ internal CollectionOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { @@ -312,7 +328,7 @@ internal CollectionOperations(CosmosDBManagementClient client) /// Retrieves the usages (most recent storage data) for the given collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -355,6 +371,13 @@ internal CollectionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -401,7 +424,17 @@ internal CollectionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionRid"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -413,7 +446,6 @@ internal CollectionOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); @@ -427,9 +459,9 @@ internal CollectionOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { @@ -564,7 +596,7 @@ internal CollectionOperations(CosmosDBManagementClient client) /// Retrieves metric definitions for the given collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -602,6 +634,13 @@ internal CollectionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -648,7 +687,17 @@ internal CollectionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionRid"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -660,7 +709,6 @@ internal CollectionOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); } @@ -673,9 +721,9 @@ internal CollectionOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperationsExtensions.cs index bfdbbbae2f86..0f6c24b4ef50 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class CollectionOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -61,7 +61,7 @@ public static IEnumerable ListMetrics(this ICollectionOperations operati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -96,7 +96,7 @@ public static IEnumerable ListMetrics(this ICollectionOperations operati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -124,7 +124,7 @@ public static IEnumerable ListMetrics(this ICollectionOperations operati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -158,7 +158,7 @@ public static IEnumerable ListMetrics(this ICollectionOperations operati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -181,7 +181,7 @@ public static IEnumerable ListMetricDefinitions(this ICollecti /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperations.cs index 49fd6ce82990..19e56cbd3001 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperations.cs @@ -55,7 +55,7 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) /// collection, split by partition. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -99,6 +99,13 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -145,11 +152,21 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionRid"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -161,7 +178,6 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -175,9 +191,9 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { @@ -313,7 +329,7 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) /// split by partition. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -356,6 +372,13 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -402,7 +425,17 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionRid"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -414,7 +447,6 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); @@ -428,9 +460,9 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperationsExtensions.cs index 9b459e9075c5..ff61045be7fe 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class CollectionPartitionOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -61,7 +61,7 @@ public static IEnumerable ListMetrics(this ICollectionPartition /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -97,7 +97,7 @@ public static IEnumerable ListMetrics(this ICollectionPartition /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -126,7 +126,7 @@ public static IEnumerable ListMetrics(this ICollectionPartition /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs index 3d0f29960248..920539d777ec 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs @@ -55,7 +55,7 @@ internal CollectionPartitionRegionOperations(CosmosDBManagementClient client) /// collection and region, split by partition. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -102,6 +102,13 @@ internal CollectionPartitionRegionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -152,11 +159,21 @@ internal CollectionPartitionRegionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionRid"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -169,7 +186,6 @@ internal CollectionPartitionRegionOperations(CosmosDBManagementClient client) tracingParameters.Add("region", region); tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -184,9 +200,9 @@ internal CollectionPartitionRegionOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperationsExtensions.cs index 819e2a04e95d..8366179034ee 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class CollectionPartitionRegionOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -64,7 +64,7 @@ public static IEnumerable ListMetrics(this ICollectionPartition /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperations.cs index 05dadab24e2f..02ff8134dfe1 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperations.cs @@ -55,7 +55,7 @@ internal CollectionRegionOperations(CosmosDBManagementClient client) /// account, collection and region. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -102,6 +102,13 @@ internal CollectionRegionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -152,11 +159,21 @@ internal CollectionRegionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionRid"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -169,7 +186,6 @@ internal CollectionRegionOperations(CosmosDBManagementClient client) tracingParameters.Add("region", region); tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -184,9 +200,9 @@ internal CollectionRegionOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperationsExtensions.cs index 00f139c37848..cea8a5b7464a 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class CollectionRegionOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -64,7 +64,7 @@ public static IEnumerable ListMetrics(this ICollectionRegionOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs index 3c0fc422cbad..c39ca310d088 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs @@ -51,6 +51,11 @@ public partial class CosmosDBManagementClient : ServiceClient public string SubscriptionId { get; set; } + /// + /// The API version to use for this operation. + /// + public string ApiVersion { get; private set; } + /// /// The ID of the target subscription. /// @@ -164,6 +169,11 @@ public partial class CosmosDBManagementClient : ServiceClient public virtual IGremlinResourcesOperations GremlinResources { get; private set; } + /// + /// Gets the INotebookWorkspacesOperations. + /// + public virtual INotebookWorkspacesOperations NotebookWorkspaces { get; private set; } + /// /// Gets the IPrivateLinkResourcesOperations. /// @@ -433,6 +443,7 @@ private void Initialize() TableResources = new TableResourcesOperations(this); CassandraResources = new CassandraResourcesOperations(this); GremlinResources = new GremlinResourcesOperations(this); + NotebookWorkspaces = new NotebookWorkspacesOperations(this); PrivateLinkResources = new PrivateLinkResourcesOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs index ec0ad6142649..49d1bc40cb2c 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs @@ -55,7 +55,7 @@ internal DatabaseAccountRegionOperations(CosmosDBManagementClient client) /// account and region. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -96,6 +96,13 @@ internal DatabaseAccountRegionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -138,11 +145,21 @@ internal DatabaseAccountRegionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "region"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -153,7 +170,6 @@ internal DatabaseAccountRegionOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("region", region); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -166,9 +182,9 @@ internal DatabaseAccountRegionOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{region}", System.Uri.EscapeDataString(region)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperationsExtensions.cs index f7462fbe72ab..e748bcd4be45 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class DatabaseAccountRegionOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -58,7 +58,7 @@ public static IEnumerable ListMetrics(this IDatabaseAccountRegionOperati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs index 9c04c2e5ac24..52ad01db17fa 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs @@ -54,7 +54,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// Retrieves the properties of an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -86,6 +86,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -124,7 +131,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -134,7 +151,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -145,9 +161,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -278,7 +294,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// Updates the properties of an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -304,7 +320,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// is preferred when performing updates on an account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -329,7 +345,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -355,7 +371,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// exists. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -403,11 +419,28 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-03-01"; + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -415,7 +448,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -424,9 +456,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -558,7 +590,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// resource group. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -602,11 +634,28 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-03-01"; + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -615,7 +664,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -625,9 +673,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -758,7 +806,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// Lists the access keys for the specified Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -790,6 +838,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -828,7 +883,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -838,7 +903,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); } @@ -849,9 +913,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -983,7 +1047,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1015,6 +1079,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1053,7 +1124,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1063,7 +1144,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStrings", tracingParameters); } @@ -1074,9 +1154,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1208,7 +1288,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1234,7 +1314,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1260,7 +1340,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1292,6 +1372,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1330,7 +1417,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1340,7 +1437,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetReadOnlyKeys", tracingParameters); } @@ -1351,9 +1447,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1485,7 +1581,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1517,6 +1613,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1555,7 +1658,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1565,7 +1678,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListReadOnlyKeys", tracingParameters); } @@ -1576,9 +1688,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1710,7 +1822,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1778,7 +1890,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1787,7 +1909,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CheckNameExists", tracingParameters); } @@ -1796,9 +1917,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}").ToString(); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1913,7 +2034,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1951,6 +2072,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1989,11 +2117,21 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2003,7 +2141,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -2015,9 +2152,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { @@ -2152,7 +2289,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// Retrieves the usages (most recent data) for the given database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2189,6 +2326,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2227,7 +2371,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2237,7 +2391,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); @@ -2249,9 +2402,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { @@ -2386,7 +2539,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// Retrieves metric definitions for the given database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2418,6 +2571,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2456,7 +2616,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2466,7 +2636,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); } @@ -2477,9 +2646,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2610,7 +2779,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// Updates the properties of an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2645,6 +2814,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2683,11 +2859,21 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateParameters"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2697,7 +2883,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateParameters", updateParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -2709,9 +2894,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2769,7 +2954,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2778,10 +2962,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2854,7 +3034,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// is preferred when performing updates on an account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2889,6 +3069,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2927,6 +3114,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateParameters"); @@ -2935,7 +3133,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { createUpdateParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2945,7 +3142,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateParameters", createUpdateParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); @@ -2957,9 +3153,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3017,7 +3213,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3026,10 +3221,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3101,7 +3292,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3130,6 +3321,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3168,7 +3366,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3178,7 +3386,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -3189,9 +3396,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3243,7 +3450,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3252,10 +3458,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3313,7 +3515,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// exists. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3345,6 +3547,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3383,6 +3592,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (failoverParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "failoverParameters"); @@ -3391,7 +3611,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { failoverParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3401,7 +3620,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("failoverParameters", failoverParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginFailoverPriorityChange", tracingParameters); @@ -3413,9 +3631,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3535,7 +3753,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3567,6 +3785,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3605,6 +3830,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (regionParameterForOffline == null) { throw new ValidationException(ValidationRules.CannotBeNull, "regionParameterForOffline"); @@ -3613,7 +3849,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { regionParameterForOffline.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3623,7 +3858,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("regionParameterForOffline", regionParameterForOffline); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginOfflineRegion", tracingParameters); @@ -3635,9 +3869,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3752,7 +3986,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3784,6 +4018,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3822,6 +4063,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (regionParameterForOnline == null) { throw new ValidationException(ValidationRules.CannotBeNull, "regionParameterForOnline"); @@ -3830,7 +4082,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { regionParameterForOnline.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3840,7 +4091,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("regionParameterForOnline", regionParameterForOnline); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginOnlineRegion", tracingParameters); @@ -3852,9 +4102,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3969,7 +4219,7 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -4001,6 +4251,13 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4039,6 +4296,17 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (keyToRegenerate == null) { throw new ValidationException(ValidationRules.CannotBeNull, "keyToRegenerate"); @@ -4047,7 +4315,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) { keyToRegenerate.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4057,7 +4324,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("keyToRegenerate", keyToRegenerate); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginRegenerateKey", tracingParameters); @@ -4069,9 +4335,9 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperationsExtensions.cs index d4e54c85d3f0..870d40cecc19 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class DatabaseAccountsOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -47,7 +47,7 @@ public static DatabaseAccountGetResults Get(this IDatabaseAccountsOperations ope /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -70,7 +70,7 @@ public static DatabaseAccountGetResults Get(this IDatabaseAccountsOperations ope /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -90,7 +90,7 @@ public static DatabaseAccountGetResults Update(this IDatabaseAccountsOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -117,7 +117,7 @@ public static DatabaseAccountGetResults Update(this IDatabaseAccountsOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -138,7 +138,7 @@ public static DatabaseAccountGetResults CreateOrUpdate(this IDatabaseAccountsOpe /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -164,7 +164,7 @@ public static DatabaseAccountGetResults CreateOrUpdate(this IDatabaseAccountsOpe /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -181,7 +181,7 @@ public static void Delete(this IDatabaseAccountsOperations operations, string re /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -205,7 +205,7 @@ public static void Delete(this IDatabaseAccountsOperations operations, string re /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -229,7 +229,7 @@ public static void FailoverPriorityChange(this IDatabaseAccountsOperations opera /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -283,7 +283,7 @@ public static IEnumerable List(this IDatabaseAccounts /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// public static IEnumerable ListByResourceGroup(this IDatabaseAccountsOperations operations, string resourceGroupName) { @@ -298,7 +298,7 @@ public static IEnumerable ListByResourceGroup(this ID /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. @@ -318,7 +318,7 @@ public static IEnumerable ListByResourceGroup(this ID /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -335,7 +335,7 @@ public static DatabaseAccountListKeysResult ListKeys(this IDatabaseAccountsOpera /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -359,7 +359,7 @@ public static DatabaseAccountListKeysResult ListKeys(this IDatabaseAccountsOpera /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -377,7 +377,7 @@ public static DatabaseAccountListConnectionStringsResult ListConnectionStrings(t /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -401,7 +401,7 @@ public static DatabaseAccountListConnectionStringsResult ListConnectionStrings(t /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -422,7 +422,7 @@ public static void OfflineRegion(this IDatabaseAccountsOperations operations, st /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -446,7 +446,7 @@ public static void OfflineRegion(this IDatabaseAccountsOperations operations, st /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -467,7 +467,7 @@ public static void OnlineRegion(this IDatabaseAccountsOperations operations, str /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -491,7 +491,7 @@ public static void OnlineRegion(this IDatabaseAccountsOperations operations, str /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -509,7 +509,7 @@ public static DatabaseAccountListReadOnlyKeysResult GetReadOnlyKeys(this IDataba /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -533,7 +533,7 @@ public static DatabaseAccountListReadOnlyKeysResult GetReadOnlyKeys(this IDataba /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -551,7 +551,7 @@ public static DatabaseAccountListReadOnlyKeysResult ListReadOnlyKeys(this IDatab /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -575,7 +575,7 @@ public static DatabaseAccountListReadOnlyKeysResult ListReadOnlyKeys(this IDatab /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -596,7 +596,7 @@ public static void RegenerateKey(this IDatabaseAccountsOperations operations, st /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -658,7 +658,7 @@ public static bool CheckNameExists(this IDatabaseAccountsOperations operations, /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -682,7 +682,7 @@ public static IEnumerable ListMetrics(this IDatabaseAccountsOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -711,7 +711,7 @@ public static IEnumerable ListMetrics(this IDatabaseAccountsOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -733,7 +733,7 @@ public static IEnumerable ListMetrics(this IDatabaseAccountsOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -761,7 +761,7 @@ public static IEnumerable ListMetrics(this IDatabaseAccountsOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -778,7 +778,7 @@ public static IEnumerable ListMetricDefinitions(this IDatabase /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -801,7 +801,7 @@ public static IEnumerable ListMetricDefinitions(this IDatabase /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -821,7 +821,7 @@ public static DatabaseAccountGetResults BeginUpdate(this IDatabaseAccountsOperat /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -848,7 +848,7 @@ public static DatabaseAccountGetResults BeginUpdate(this IDatabaseAccountsOperat /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -869,7 +869,7 @@ public static DatabaseAccountGetResults BeginCreateOrUpdate(this IDatabaseAccoun /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -895,7 +895,7 @@ public static DatabaseAccountGetResults BeginCreateOrUpdate(this IDatabaseAccoun /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -912,7 +912,7 @@ public static void BeginDelete(this IDatabaseAccountsOperations operations, stri /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -936,7 +936,7 @@ public static void BeginDelete(this IDatabaseAccountsOperations operations, stri /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -960,7 +960,7 @@ public static void BeginFailoverPriorityChange(this IDatabaseAccountsOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -984,7 +984,7 @@ public static void BeginFailoverPriorityChange(this IDatabaseAccountsOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1005,7 +1005,7 @@ public static void BeginOfflineRegion(this IDatabaseAccountsOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1029,7 +1029,7 @@ public static void BeginOfflineRegion(this IDatabaseAccountsOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1050,7 +1050,7 @@ public static void BeginOnlineRegion(this IDatabaseAccountsOperations operations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1074,7 +1074,7 @@ public static void BeginOnlineRegion(this IDatabaseAccountsOperations operations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1095,7 +1095,7 @@ public static void BeginRegenerateKey(this IDatabaseAccountsOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperations.cs index 689e99f7168c..9355f5c552ba 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperations.cs @@ -55,7 +55,7 @@ internal DatabaseOperations(CosmosDBManagementClient client) /// account and database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -96,6 +96,13 @@ internal DatabaseOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -138,11 +145,21 @@ internal DatabaseOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseRid"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -153,7 +170,6 @@ internal DatabaseOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseRid", databaseRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -166,9 +182,9 @@ internal DatabaseOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { @@ -303,7 +319,7 @@ internal DatabaseOperations(CosmosDBManagementClient client) /// Retrieves the usages (most recent data) for the given database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -343,6 +359,13 @@ internal DatabaseOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -385,7 +408,17 @@ internal DatabaseOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseRid"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -396,7 +429,6 @@ internal DatabaseOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseRid", databaseRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); @@ -409,9 +441,9 @@ internal DatabaseOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { @@ -546,7 +578,7 @@ internal DatabaseOperations(CosmosDBManagementClient client) /// Retrieves metric definitions for the given database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -581,6 +613,13 @@ internal DatabaseOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -623,7 +662,17 @@ internal DatabaseOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseRid"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -634,7 +683,6 @@ internal DatabaseOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseRid", databaseRid); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); } @@ -646,9 +694,9 @@ internal DatabaseOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperationsExtensions.cs index 09af3229b5ba..0d9ed4ca2134 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class DatabaseOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -58,7 +58,7 @@ public static IEnumerable ListMetrics(this IDatabaseOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -90,7 +90,7 @@ public static IEnumerable ListMetrics(this IDatabaseOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -115,7 +115,7 @@ public static IEnumerable ListMetrics(this IDatabaseOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -146,7 +146,7 @@ public static IEnumerable ListMetrics(this IDatabaseOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -166,7 +166,7 @@ public static IEnumerable ListMetricDefinitions(this IDatabase /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs index 1620990f0694..fb0112d16938 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs @@ -55,7 +55,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -87,6 +87,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -125,7 +132,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -135,7 +152,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListGremlinDatabases", tracingParameters); } @@ -146,9 +162,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -280,7 +296,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -315,6 +331,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -357,7 +380,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -368,7 +401,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetGremlinDatabase", tracingParameters); } @@ -380,9 +412,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -513,7 +545,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Gremlin database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -541,7 +573,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -567,7 +599,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -602,6 +634,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -644,7 +683,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -655,7 +704,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetGremlinDatabaseThroughput", tracingParameters); } @@ -667,9 +715,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -800,7 +848,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Gremlin database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -829,7 +877,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -864,6 +912,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -906,7 +961,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -917,7 +982,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListGremlinGraphs", tracingParameters); } @@ -929,9 +993,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1062,7 +1126,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1100,6 +1164,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1146,7 +1217,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1158,7 +1239,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetGremlinGraph", tracingParameters); } @@ -1171,9 +1251,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1304,7 +1384,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Gremlin graph /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1335,7 +1415,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1364,7 +1444,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1402,6 +1482,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1448,7 +1535,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1460,7 +1557,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetGremlinGraphThroughput", tracingParameters); } @@ -1473,9 +1569,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1606,7 +1702,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1638,7 +1734,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Gremlin database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1676,6 +1772,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1718,6 +1821,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateGremlinDatabaseParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateGremlinDatabaseParameters"); @@ -1726,7 +1840,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { createUpdateGremlinDatabaseParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1737,7 +1850,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateGremlinDatabaseParameters", createUpdateGremlinDatabaseParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateGremlinDatabase", tracingParameters); @@ -1750,9 +1862,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1810,7 +1922,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1819,10 +1930,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -1894,7 +2001,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1926,6 +2033,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1968,7 +2082,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1979,7 +2103,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteGremlinDatabase", tracingParameters); } @@ -1991,9 +2114,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2045,7 +2168,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2054,10 +2176,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2111,7 +2229,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Gremlin database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2150,6 +2268,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2192,6 +2317,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -2200,7 +2336,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2211,7 +2346,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateGremlinDatabaseThroughput", tracingParameters); @@ -2224,9 +2358,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2284,7 +2418,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2293,10 +2426,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2368,7 +2497,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Gremlin graph /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2409,6 +2538,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2455,6 +2591,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "graphName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateGremlinGraphParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateGremlinGraphParameters"); @@ -2463,7 +2610,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { createUpdateGremlinGraphParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2475,7 +2621,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateGremlinGraphParameters", createUpdateGremlinGraphParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateGremlinGraph", tracingParameters); @@ -2489,9 +2634,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2549,7 +2694,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2558,10 +2702,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2633,7 +2773,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2668,6 +2808,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2714,7 +2861,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2726,7 +2883,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteGremlinGraph", tracingParameters); } @@ -2739,9 +2895,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2793,7 +2949,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2802,10 +2957,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2859,7 +3010,7 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2901,6 +3052,13 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2947,6 +3105,17 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "graphName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -2955,7 +3124,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2967,7 +3135,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateGremlinGraphThroughput", tracingParameters); @@ -2981,9 +3148,9 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3041,7 +3208,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3050,10 +3216,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperationsExtensions.cs index 2f3de3aa95bc..1d13db52cb8d 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class GremlinResourcesOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -49,7 +49,7 @@ public static IEnumerable ListGremlinDatabases(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -73,7 +73,7 @@ public static IEnumerable ListGremlinDatabases(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -94,7 +94,7 @@ public static GremlinDatabaseGetResults GetGremlinDatabase(this IGremlinResource /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -120,7 +120,7 @@ public static GremlinDatabaseGetResults GetGremlinDatabase(this IGremlinResource /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -143,7 +143,7 @@ public static GremlinDatabaseGetResults CreateUpdateGremlinDatabase(this IGremli /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -172,7 +172,7 @@ public static GremlinDatabaseGetResults CreateUpdateGremlinDatabase(this IGremli /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -192,7 +192,7 @@ public static void DeleteGremlinDatabase(this IGremlinResourcesOperations operat /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -216,7 +216,7 @@ public static void DeleteGremlinDatabase(this IGremlinResourcesOperations operat /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -237,7 +237,7 @@ public static ThroughputSettingsGetResults GetGremlinDatabaseThroughput(this IGr /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -263,7 +263,7 @@ public static ThroughputSettingsGetResults GetGremlinDatabaseThroughput(this IGr /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -287,7 +287,7 @@ public static ThroughputSettingsGetResults UpdateGremlinDatabaseThroughput(this /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -317,7 +317,7 @@ public static ThroughputSettingsGetResults UpdateGremlinDatabaseThroughput(this /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -337,7 +337,7 @@ public static IEnumerable ListGremlinGraphs(this IGremli /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -363,7 +363,7 @@ public static IEnumerable ListGremlinGraphs(this IGremli /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -386,7 +386,7 @@ public static GremlinGraphGetResults GetGremlinGraph(this IGremlinResourcesOpera /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -415,7 +415,7 @@ public static GremlinGraphGetResults GetGremlinGraph(this IGremlinResourcesOpera /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -441,7 +441,7 @@ public static GremlinGraphGetResults CreateUpdateGremlinGraph(this IGremlinResou /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -473,7 +473,7 @@ public static GremlinGraphGetResults CreateUpdateGremlinGraph(this IGremlinResou /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -496,7 +496,7 @@ public static void DeleteGremlinGraph(this IGremlinResourcesOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -523,7 +523,7 @@ public static void DeleteGremlinGraph(this IGremlinResourcesOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -547,7 +547,7 @@ public static ThroughputSettingsGetResults GetGremlinGraphThroughput(this IGreml /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -576,7 +576,7 @@ public static ThroughputSettingsGetResults GetGremlinGraphThroughput(this IGreml /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -603,7 +603,7 @@ public static ThroughputSettingsGetResults UpdateGremlinGraphThroughput(this IGr /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -636,7 +636,7 @@ public static ThroughputSettingsGetResults UpdateGremlinGraphThroughput(this IGr /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -659,7 +659,7 @@ public static GremlinDatabaseGetResults BeginCreateUpdateGremlinDatabase(this IG /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -688,7 +688,7 @@ public static GremlinDatabaseGetResults BeginCreateUpdateGremlinDatabase(this IG /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -708,7 +708,7 @@ public static void BeginDeleteGremlinDatabase(this IGremlinResourcesOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -731,7 +731,7 @@ public static void BeginDeleteGremlinDatabase(this IGremlinResourcesOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -755,7 +755,7 @@ public static ThroughputSettingsGetResults BeginUpdateGremlinDatabaseThroughput( /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -785,7 +785,7 @@ public static ThroughputSettingsGetResults BeginUpdateGremlinDatabaseThroughput( /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -811,7 +811,7 @@ public static GremlinGraphGetResults BeginCreateUpdateGremlinGraph(this IGremlin /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -843,7 +843,7 @@ public static GremlinGraphGetResults BeginCreateUpdateGremlinGraph(this IGremlin /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -866,7 +866,7 @@ public static void BeginDeleteGremlinGraph(this IGremlinResourcesOperations oper /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -892,7 +892,7 @@ public static void BeginDeleteGremlinGraph(this IGremlinResourcesOperations oper /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -919,7 +919,7 @@ public static ThroughputSettingsGetResults BeginUpdateGremlinGraphThroughput(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICassandraResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICassandraResourcesOperations.cs index 161755adf2a4..966b081c8321 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICassandraResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICassandraResourcesOperations.cs @@ -28,7 +28,7 @@ public partial interface ICassandraResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -54,7 +54,7 @@ public partial interface ICassandraResourcesOperations /// database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -82,7 +82,7 @@ public partial interface ICassandraResourcesOperations /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -113,7 +113,7 @@ public partial interface ICassandraResourcesOperations /// Deletes an existing Azure Cosmos DB Cassandra keyspace. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -139,7 +139,7 @@ public partial interface ICassandraResourcesOperations /// Azure Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -167,7 +167,7 @@ public partial interface ICassandraResourcesOperations /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -200,7 +200,7 @@ public partial interface ICassandraResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -229,7 +229,7 @@ public partial interface ICassandraResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -260,7 +260,7 @@ public partial interface ICassandraResourcesOperations /// Create or update an Azure Cosmos DB Cassandra Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -294,7 +294,7 @@ public partial interface ICassandraResourcesOperations /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -323,7 +323,7 @@ public partial interface ICassandraResourcesOperations /// Azure Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -354,7 +354,7 @@ public partial interface ICassandraResourcesOperations /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -389,7 +389,7 @@ public partial interface ICassandraResourcesOperations /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -420,7 +420,7 @@ public partial interface ICassandraResourcesOperations /// Deletes an existing Azure Cosmos DB Cassandra keyspace. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -445,7 +445,7 @@ public partial interface ICassandraResourcesOperations /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -477,7 +477,7 @@ public partial interface ICassandraResourcesOperations /// Create or update an Azure Cosmos DB Cassandra Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -511,7 +511,7 @@ public partial interface ICassandraResourcesOperations /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -539,7 +539,7 @@ public partial interface ICassandraResourcesOperations /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionOperations.cs index a1e398d36729..a44622b0ce22 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionOperations.cs @@ -28,7 +28,7 @@ public partial interface ICollectionOperations /// database account and collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -66,7 +66,7 @@ public partial interface ICollectionOperations /// collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -102,7 +102,7 @@ public partial interface ICollectionOperations /// Retrieves metric definitions for the given collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionPartitionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionPartitionOperations.cs index 057758abd5d8..9f1f3dbf4397 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionPartitionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionPartitionOperations.cs @@ -28,7 +28,7 @@ public partial interface ICollectionPartitionOperations /// collection, split by partition. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -66,7 +66,7 @@ public partial interface ICollectionPartitionOperations /// collection, split by partition. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionPartitionRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionPartitionRegionOperations.cs index 433df81a8213..cab5af7813f2 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionPartitionRegionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionPartitionRegionOperations.cs @@ -28,7 +28,7 @@ public partial interface ICollectionPartitionRegionOperations /// collection and region, split by partition. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionRegionOperations.cs index edec27d3307c..498a6ca830d6 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionRegionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICollectionRegionOperations.cs @@ -28,7 +28,7 @@ public partial interface ICollectionRegionOperations /// database account, collection and region. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs index e1cbd9db1c2e..b74e98610246 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs @@ -45,6 +45,11 @@ public partial interface ICosmosDBManagementClient : System.IDisposable /// string SubscriptionId { get; set; } + /// + /// The API version to use for this operation. + /// + string ApiVersion { get; } + /// /// The ID of the target subscription. /// @@ -159,6 +164,11 @@ public partial interface ICosmosDBManagementClient : System.IDisposable /// IGremlinResourcesOperations GremlinResources { get; } + /// + /// Gets the INotebookWorkspacesOperations. + /// + INotebookWorkspacesOperations NotebookWorkspaces { get; } + /// /// Gets the IPrivateLinkResourcesOperations. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseAccountRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseAccountRegionOperations.cs index 0d59cac5fdaf..dab0d857da38 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseAccountRegionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseAccountRegionOperations.cs @@ -28,7 +28,7 @@ public partial interface IDatabaseAccountRegionOperations /// database account and region. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseAccountsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseAccountsOperations.cs index 386b2c831421..b8e20152d97b 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseAccountsOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseAccountsOperations.cs @@ -28,7 +28,7 @@ public partial interface IDatabaseAccountsOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -54,7 +54,7 @@ public partial interface IDatabaseAccountsOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -83,7 +83,7 @@ public partial interface IDatabaseAccountsOperations /// "Update" method is preferred when performing updates on an account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -111,7 +111,7 @@ public partial interface IDatabaseAccountsOperations /// Deletes an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -137,7 +137,7 @@ public partial interface IDatabaseAccountsOperations /// in which the database account exists. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -183,7 +183,7 @@ public partial interface IDatabaseAccountsOperations /// given resource group. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -206,7 +206,7 @@ public partial interface IDatabaseAccountsOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -232,7 +232,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -258,7 +258,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -284,7 +284,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -310,7 +310,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -336,7 +336,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -362,7 +362,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -409,7 +409,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -441,7 +441,7 @@ public partial interface IDatabaseAccountsOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -471,7 +471,7 @@ public partial interface IDatabaseAccountsOperations /// Retrieves metric definitions for the given database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -497,7 +497,7 @@ public partial interface IDatabaseAccountsOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -526,7 +526,7 @@ public partial interface IDatabaseAccountsOperations /// "Update" method is preferred when performing updates on an account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -554,7 +554,7 @@ public partial interface IDatabaseAccountsOperations /// Deletes an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -580,7 +580,7 @@ public partial interface IDatabaseAccountsOperations /// in which the database account exists. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -606,7 +606,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -632,7 +632,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -658,7 +658,7 @@ public partial interface IDatabaseAccountsOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseOperations.cs index 2dfd8e669d43..71acec7aa4eb 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IDatabaseOperations.cs @@ -28,7 +28,7 @@ public partial interface IDatabaseOperations /// database account and database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -62,7 +62,7 @@ public partial interface IDatabaseOperations /// Retrieves the usages (most recent data) for the given database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -95,7 +95,7 @@ public partial interface IDatabaseOperations /// Retrieves metric definitions for the given database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IGremlinResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IGremlinResourcesOperations.cs index 85e47025e83e..47ea75367fba 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IGremlinResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IGremlinResourcesOperations.cs @@ -28,7 +28,7 @@ public partial interface IGremlinResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -54,7 +54,7 @@ public partial interface IGremlinResourcesOperations /// database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -82,7 +82,7 @@ public partial interface IGremlinResourcesOperations /// Create or update an Azure Cosmos DB Gremlin database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -113,7 +113,7 @@ public partial interface IGremlinResourcesOperations /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -139,7 +139,7 @@ public partial interface IGremlinResourcesOperations /// Azure Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -167,7 +167,7 @@ public partial interface IGremlinResourcesOperations /// Update RUs per second of an Azure Cosmos DB Gremlin database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -200,7 +200,7 @@ public partial interface IGremlinResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -229,7 +229,7 @@ public partial interface IGremlinResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -260,7 +260,7 @@ public partial interface IGremlinResourcesOperations /// Create or update an Azure Cosmos DB Gremlin graph /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -294,7 +294,7 @@ public partial interface IGremlinResourcesOperations /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -323,7 +323,7 @@ public partial interface IGremlinResourcesOperations /// database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -354,7 +354,7 @@ public partial interface IGremlinResourcesOperations /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -389,7 +389,7 @@ public partial interface IGremlinResourcesOperations /// Create or update an Azure Cosmos DB Gremlin database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -420,7 +420,7 @@ public partial interface IGremlinResourcesOperations /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -445,7 +445,7 @@ public partial interface IGremlinResourcesOperations /// Update RUs per second of an Azure Cosmos DB Gremlin database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -477,7 +477,7 @@ public partial interface IGremlinResourcesOperations /// Create or update an Azure Cosmos DB Gremlin graph /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -511,7 +511,7 @@ public partial interface IGremlinResourcesOperations /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -539,7 +539,7 @@ public partial interface IGremlinResourcesOperations /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IMongoDBResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IMongoDBResourcesOperations.cs index 4a610a6368c4..9573f48a4752 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IMongoDBResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IMongoDBResourcesOperations.cs @@ -28,7 +28,7 @@ public partial interface IMongoDBResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -54,7 +54,7 @@ public partial interface IMongoDBResourcesOperations /// database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -82,7 +82,7 @@ public partial interface IMongoDBResourcesOperations /// Create or updates Azure Cosmos DB MongoDB database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -113,7 +113,7 @@ public partial interface IMongoDBResourcesOperations /// Deletes an existing Azure Cosmos DB MongoDB database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -139,7 +139,7 @@ public partial interface IMongoDBResourcesOperations /// Azure Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -167,7 +167,7 @@ public partial interface IMongoDBResourcesOperations /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -200,7 +200,7 @@ public partial interface IMongoDBResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -229,7 +229,7 @@ public partial interface IMongoDBResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -260,7 +260,7 @@ public partial interface IMongoDBResourcesOperations /// Create or update an Azure Cosmos DB MongoDB Collection /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -294,7 +294,7 @@ public partial interface IMongoDBResourcesOperations /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -323,7 +323,7 @@ public partial interface IMongoDBResourcesOperations /// Azure Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -354,7 +354,7 @@ public partial interface IMongoDBResourcesOperations /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -389,7 +389,7 @@ public partial interface IMongoDBResourcesOperations /// Create or updates Azure Cosmos DB MongoDB database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -420,7 +420,7 @@ public partial interface IMongoDBResourcesOperations /// Deletes an existing Azure Cosmos DB MongoDB database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -445,7 +445,7 @@ public partial interface IMongoDBResourcesOperations /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -477,7 +477,7 @@ public partial interface IMongoDBResourcesOperations /// Create or update an Azure Cosmos DB MongoDB Collection /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -511,7 +511,7 @@ public partial interface IMongoDBResourcesOperations /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -539,7 +539,7 @@ public partial interface IMongoDBResourcesOperations /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/INotebookWorkspacesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/INotebookWorkspacesOperations.cs new file mode 100644 index 000000000000..d11abb6f2108 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/INotebookWorkspacesOperations.cs @@ -0,0 +1,285 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NotebookWorkspacesOperations operations. + /// + public partial interface INotebookWorkspacesOperations + { + /// + /// Gets the notebook workspace resources of an existing Cosmos DB + /// account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves the connection info for the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListConnectionInfoWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Starts the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task StartWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Starts the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPartitionKeyRangeIdOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPartitionKeyRangeIdOperations.cs index 13664429f54d..a90efbb9d2dd 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPartitionKeyRangeIdOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPartitionKeyRangeIdOperations.cs @@ -28,7 +28,7 @@ public partial interface IPartitionKeyRangeIdOperations /// partition key range id. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPartitionKeyRangeIdRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPartitionKeyRangeIdRegionOperations.cs index a6d8f3e06639..f3115e539220 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPartitionKeyRangeIdRegionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPartitionKeyRangeIdRegionOperations.cs @@ -28,7 +28,7 @@ public partial interface IPartitionKeyRangeIdRegionOperations /// partition key range id and region. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileOperations.cs index d6c36167cc1b..151643423553 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileOperations.cs @@ -29,7 +29,7 @@ public partial interface IPercentileOperations /// data /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileSourceTargetOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileSourceTargetOperations.cs index 73713ff7a739..cb882f45bc33 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileSourceTargetOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileSourceTargetOperations.cs @@ -29,7 +29,7 @@ public partial interface IPercentileSourceTargetOperations /// Replication Latency data /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileTargetOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileTargetOperations.cs index 719a1bf96e15..40b91e480eab 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileTargetOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPercentileTargetOperations.cs @@ -29,7 +29,7 @@ public partial interface IPercentileTargetOperations /// Latency data /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPrivateLinkResourcesOperations.cs index 9f87c9055b17..b03b8a43a6f0 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPrivateLinkResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IPrivateLinkResourcesOperations.cs @@ -28,7 +28,7 @@ public partial interface IPrivateLinkResourcesOperations /// Cosmos DB account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -54,7 +54,7 @@ public partial interface IPrivateLinkResourcesOperations /// Cosmos DB account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ISqlResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ISqlResourcesOperations.cs index 78ff634614bc..e722401553bc 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ISqlResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ISqlResourcesOperations.cs @@ -28,7 +28,7 @@ public partial interface ISqlResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -54,7 +54,7 @@ public partial interface ISqlResourcesOperations /// account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -82,7 +82,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -113,7 +113,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -139,7 +139,7 @@ public partial interface ISqlResourcesOperations /// Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -167,7 +167,7 @@ public partial interface ISqlResourcesOperations /// Update RUs per second of an Azure Cosmos DB SQL database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -200,7 +200,7 @@ public partial interface ISqlResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -229,7 +229,7 @@ public partial interface ISqlResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -260,7 +260,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL container /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -294,7 +294,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL container. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -323,7 +323,7 @@ public partial interface ISqlResourcesOperations /// Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -354,7 +354,7 @@ public partial interface ISqlResourcesOperations /// Update RUs per second of an Azure Cosmos DB SQL container /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -390,7 +390,7 @@ public partial interface ISqlResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -422,7 +422,7 @@ public partial interface ISqlResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -456,7 +456,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -493,7 +493,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -525,7 +525,7 @@ public partial interface ISqlResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -557,7 +557,7 @@ public partial interface ISqlResourcesOperations /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -591,7 +591,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -628,7 +628,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -660,7 +660,7 @@ public partial interface ISqlResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -692,7 +692,7 @@ public partial interface ISqlResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -726,7 +726,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL trigger /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -763,7 +763,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -794,7 +794,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -825,7 +825,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -850,7 +850,7 @@ public partial interface ISqlResourcesOperations /// Update RUs per second of an Azure Cosmos DB SQL database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -882,7 +882,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL container /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -916,7 +916,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL container. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -944,7 +944,7 @@ public partial interface ISqlResourcesOperations /// Update RUs per second of an Azure Cosmos DB SQL container /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -979,7 +979,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1016,7 +1016,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1047,7 +1047,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1084,7 +1084,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1115,7 +1115,7 @@ public partial interface ISqlResourcesOperations /// Create or update an Azure Cosmos DB SQL trigger /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1152,7 +1152,7 @@ public partial interface ISqlResourcesOperations /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ITableResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ITableResourcesOperations.cs index 2ca46c0d3883..233c74e6f42c 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ITableResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ITableResourcesOperations.cs @@ -28,7 +28,7 @@ public partial interface ITableResourcesOperations /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -54,7 +54,7 @@ public partial interface ITableResourcesOperations /// with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -82,7 +82,7 @@ public partial interface ITableResourcesOperations /// Create or update an Azure Cosmos DB Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -113,7 +113,7 @@ public partial interface ITableResourcesOperations /// Deletes an existing Azure Cosmos DB Table. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -139,7 +139,7 @@ public partial interface ITableResourcesOperations /// DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -167,7 +167,7 @@ public partial interface ITableResourcesOperations /// Update RUs per second of an Azure Cosmos DB Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -199,7 +199,7 @@ public partial interface ITableResourcesOperations /// Create or update an Azure Cosmos DB Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -230,7 +230,7 @@ public partial interface ITableResourcesOperations /// Deletes an existing Azure Cosmos DB Table. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -255,7 +255,7 @@ public partial interface ITableResourcesOperations /// Update RUs per second of an Azure Cosmos DB Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesOptions.cs new file mode 100644 index 000000000000..cb24390abb9c --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class CassandraKeyspaceGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// CassandraKeyspaceGetPropertiesOptions class. + /// + public CassandraKeyspaceGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CassandraKeyspaceGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public CassandraKeyspaceGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetResults.cs index 4cf74824ad86..34d756d6cd7d 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetResults.cs @@ -42,10 +42,11 @@ public CassandraKeyspaceGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public CassandraKeyspaceGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CassandraKeyspaceGetPropertiesResource resource = default(CassandraKeyspaceGetPropertiesResource)) + public CassandraKeyspaceGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CassandraKeyspaceGetPropertiesResource resource = default(CassandraKeyspaceGetPropertiesResource), CassandraKeyspaceGetPropertiesOptions options = default(CassandraKeyspaceGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -59,6 +60,11 @@ public CassandraKeyspaceGetResults() [JsonProperty(PropertyName = "properties.resource")] public CassandraKeyspaceGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public CassandraKeyspaceGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesOptions.cs new file mode 100644 index 000000000000..e881fa2d015d --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class CassandraTableGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// CassandraTableGetPropertiesOptions class. + /// + public CassandraTableGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CassandraTableGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public CassandraTableGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetResults.cs index 4b5478d478c4..bbe765553a15 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetResults.cs @@ -40,10 +40,11 @@ public CassandraTableGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public CassandraTableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CassandraTableGetPropertiesResource resource = default(CassandraTableGetPropertiesResource)) + public CassandraTableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CassandraTableGetPropertiesResource resource = default(CassandraTableGetPropertiesResource), CassandraTableGetPropertiesOptions options = default(CassandraTableGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public CassandraTableGetResults() [JsonProperty(PropertyName = "properties.resource")] public CassandraTableGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public CassandraTableGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateUpdateOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateUpdateOptions.cs index d5fc7205aa3f..7ccd52085168 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateUpdateOptions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateUpdateOptions.cs @@ -53,6 +53,7 @@ public CreateUpdateOptions() /// Gets or sets unmatched properties from the message are deserialized /// this collection /// + [JsonExtensionData] public IDictionary AdditionalProperties { get; set; } /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs index bc2a1deb0216..bf3c090e4a18 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs @@ -74,6 +74,8 @@ public DatabaseAccountGetResults() /// ordered by their failover priorities. /// List of Virtual Network ACL rules /// configured for the Cosmos DB account. + /// List of Private Endpoint + /// Connections configured for the Cosmos DB account. /// Enables the account to /// write in multiple locations /// Enables the cassandra @@ -88,7 +90,7 @@ public DatabaseAccountGetResults() /// Whether requests from Public /// Network are allowed. Possible values include: 'Enabled', /// 'Disabled' - public DatabaseAccountGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountOfferType? databaseAccountOfferType = default(DatabaseAccountOfferType?), string ipRangeFilter = default(string), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList capabilities = default(IList), IList writeLocations = default(IList), IList readLocations = default(IList), IList locations = default(IList), IList failoverPolicies = default(IList), IList virtualNetworkRules = default(IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string publicNetworkAccess = default(string)) + public DatabaseAccountGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountOfferType? databaseAccountOfferType = default(DatabaseAccountOfferType?), string ipRangeFilter = default(string), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList capabilities = default(IList), IList writeLocations = default(IList), IList readLocations = default(IList), IList locations = default(IList), IList failoverPolicies = default(IList), IList virtualNetworkRules = default(IList), IList privateEndpointConnections = default(IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string publicNetworkAccess = default(string)) : base(id, name, type, location, tags) { Kind = kind; @@ -105,6 +107,7 @@ public DatabaseAccountGetResults() Locations = locations; FailoverPolicies = failoverPolicies; VirtualNetworkRules = virtualNetworkRules; + PrivateEndpointConnections = privateEndpointConnections; EnableMultipleWriteLocations = enableMultipleWriteLocations; EnableCassandraConnector = enableCassandraConnector; ConnectorOffer = connectorOffer; @@ -220,6 +223,13 @@ public DatabaseAccountGetResults() [JsonProperty(PropertyName = "properties.virtualNetworkRules")] public IList VirtualNetworkRules { get; set; } + /// + /// Gets list of Private Endpoint Connections configured for the Cosmos + /// DB account. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + /// /// Gets or sets enables the account to write in multiple locations /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesOptions.cs new file mode 100644 index 000000000000..b966aff4f441 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class GremlinDatabaseGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// GremlinDatabaseGetPropertiesOptions class. + /// + public GremlinDatabaseGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GremlinDatabaseGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public GremlinDatabaseGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetResults.cs index 313c16cf09d6..9a89af0bd5ea 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetResults.cs @@ -40,10 +40,11 @@ public GremlinDatabaseGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public GremlinDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), GremlinDatabaseGetPropertiesResource resource = default(GremlinDatabaseGetPropertiesResource)) + public GremlinDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), GremlinDatabaseGetPropertiesResource resource = default(GremlinDatabaseGetPropertiesResource), GremlinDatabaseGetPropertiesOptions options = default(GremlinDatabaseGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public GremlinDatabaseGetResults() [JsonProperty(PropertyName = "properties.resource")] public GremlinDatabaseGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public GremlinDatabaseGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesOptions.cs new file mode 100644 index 000000000000..f0e65250da0c --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class GremlinGraphGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the GremlinGraphGetPropertiesOptions + /// class. + /// + public GremlinGraphGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinGraphGetPropertiesOptions + /// class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public GremlinGraphGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetResults.cs index 9989bf70f8b1..a0736cbceec3 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetResults.cs @@ -40,10 +40,11 @@ public GremlinGraphGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public GremlinGraphGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), GremlinGraphGetPropertiesResource resource = default(GremlinGraphGetPropertiesResource)) + public GremlinGraphGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), GremlinGraphGetPropertiesResource resource = default(GremlinGraphGetPropertiesResource), GremlinGraphGetPropertiesOptions options = default(GremlinGraphGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public GremlinGraphGetResults() [JsonProperty(PropertyName = "properties.resource")] public GremlinGraphGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public GremlinGraphGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesOptions.cs new file mode 100644 index 000000000000..67aad07ad142 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class MongoDBCollectionGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// MongoDBCollectionGetPropertiesOptions class. + /// + public MongoDBCollectionGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MongoDBCollectionGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public MongoDBCollectionGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetResults.cs index e1718b52cf27..175756c84be5 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetResults.cs @@ -42,10 +42,11 @@ public MongoDBCollectionGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public MongoDBCollectionGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), MongoDBCollectionGetPropertiesResource resource = default(MongoDBCollectionGetPropertiesResource)) + public MongoDBCollectionGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), MongoDBCollectionGetPropertiesResource resource = default(MongoDBCollectionGetPropertiesResource), MongoDBCollectionGetPropertiesOptions options = default(MongoDBCollectionGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -59,6 +60,11 @@ public MongoDBCollectionGetResults() [JsonProperty(PropertyName = "properties.resource")] public MongoDBCollectionGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public MongoDBCollectionGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesOptions.cs new file mode 100644 index 000000000000..438d8c76fc47 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class MongoDBDatabaseGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// MongoDBDatabaseGetPropertiesOptions class. + /// + public MongoDBDatabaseGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MongoDBDatabaseGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public MongoDBDatabaseGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetResults.cs index 74e34cd999ed..1221e26766ac 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetResults.cs @@ -40,10 +40,11 @@ public MongoDBDatabaseGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public MongoDBDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), MongoDBDatabaseGetPropertiesResource resource = default(MongoDBDatabaseGetPropertiesResource)) + public MongoDBDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), MongoDBDatabaseGetPropertiesResource resource = default(MongoDBDatabaseGetPropertiesResource), MongoDBDatabaseGetPropertiesOptions options = default(MongoDBDatabaseGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public MongoDBDatabaseGetResults() [JsonProperty(PropertyName = "properties.resource")] public MongoDBDatabaseGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public MongoDBDatabaseGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspace.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspace.cs new file mode 100644 index 000000000000..5df0b25fbfb5 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspace.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A notebook workspace resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NotebookWorkspace : ARMProxyResource + { + /// + /// Initializes a new instance of the NotebookWorkspace class. + /// + public NotebookWorkspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookWorkspace class. + /// + /// The unique resource identifier of the database + /// account. + /// The name of the database account. + /// The type of Azure resource. + /// Specifies the endpoint of + /// Notebook server. + /// Status of the notebook workspace. Possible + /// values are: Creating, Online, Deleting, Failed, Updating. + public NotebookWorkspace(string id = default(string), string name = default(string), string type = default(string), string notebookServerEndpoint = default(string), string status = default(string)) + : base(id, name, type) + { + NotebookServerEndpoint = notebookServerEndpoint; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the endpoint of Notebook server. + /// + [JsonProperty(PropertyName = "properties.notebookServerEndpoint")] + public string NotebookServerEndpoint { get; private set; } + + /// + /// Gets status of the notebook workspace. Possible values are: + /// Creating, Online, Deleting, Failed, Updating. + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceConnectionInfoResult.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceConnectionInfoResult.cs new file mode 100644 index 000000000000..cb4393139255 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceConnectionInfoResult.cs @@ -0,0 +1,64 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The connection info for the given notebook workspace + /// + public partial class NotebookWorkspaceConnectionInfoResult + { + /// + /// Initializes a new instance of the + /// NotebookWorkspaceConnectionInfoResult class. + /// + public NotebookWorkspaceConnectionInfoResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NotebookWorkspaceConnectionInfoResult class. + /// + /// Specifies auth token used for connecting to + /// Notebook server (uses token-based auth). + /// Specifies the endpoint of + /// Notebook server. + public NotebookWorkspaceConnectionInfoResult(string authToken = default(string), string notebookServerEndpoint = default(string)) + { + AuthToken = authToken; + NotebookServerEndpoint = notebookServerEndpoint; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies auth token used for connecting to Notebook server + /// (uses token-based auth). + /// + [JsonProperty(PropertyName = "authToken")] + public string AuthToken { get; private set; } + + /// + /// Gets specifies the endpoint of Notebook server. + /// + [JsonProperty(PropertyName = "notebookServerEndpoint")] + public string NotebookServerEndpoint { get; private set; } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceCreateUpdateParameters.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceCreateUpdateParameters.cs new file mode 100644 index 000000000000..415b2604e14b --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceCreateUpdateParameters.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + /// + /// Parameters to create a notebook workspace resource + /// + public partial class NotebookWorkspaceCreateUpdateParameters : ARMProxyResource + { + /// + /// Initializes a new instance of the + /// NotebookWorkspaceCreateUpdateParameters class. + /// + public NotebookWorkspaceCreateUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NotebookWorkspaceCreateUpdateParameters class. + /// + /// The unique resource identifier of the database + /// account. + /// The name of the database account. + /// The type of Azure resource. + public NotebookWorkspaceCreateUpdateParameters(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OptionsResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OptionsResource.cs new file mode 100644 index 000000000000..cbeec5b5998f --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OptionsResource.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Cosmos DB options resource object + /// + public partial class OptionsResource + { + /// + /// Initializes a new instance of the OptionsResource class. + /// + public OptionsResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OptionsResource class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public OptionsResource(int? throughput = default(int?)) + { + Throughput = throughput; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets value of the Cosmos DB resource throughput. Use the + /// ThroughputSetting resource when retrieving offer details. + /// + [JsonProperty(PropertyName = "throughput")] + public int? Throughput { get; set; } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateEndpointConnection.cs index 7049f0a98cce..7254b3092afe 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateEndpointConnection.cs @@ -42,11 +42,16 @@ public PrivateEndpointConnection() /// belongs to. /// Connection State of /// the Private Endpoint Connection. - public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpointProperty privateEndpoint = default(PrivateEndpointProperty), PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionStateProperty)) + /// Group id of the private endpoint. + /// Provisioning state of the private + /// endpoint. + public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpointProperty privateEndpoint = default(PrivateEndpointProperty), PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionStateProperty), string groupId = default(string), string provisioningState = default(string)) : base(id, name, type) { PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + GroupId = groupId; + ProvisioningState = provisioningState; CustomInit(); } @@ -67,5 +72,17 @@ public PrivateEndpointConnection() [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] public PrivateLinkServiceConnectionStateProperty PrivateLinkServiceConnectionState { get; set; } + /// + /// Gets or sets group id of the private endpoint. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; set; } + + /// + /// Gets or sets provisioning state of the private endpoint. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + } } diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateLinkResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateLinkResource.cs index 516990b36a04..0250aeb5c863 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateLinkResource.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateLinkResource.cs @@ -41,11 +41,14 @@ public PrivateLinkResource() /// The private link resource group id. /// The private link resource required /// member names. - public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList)) + /// The private link resource required + /// zone names. + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) : base(id, name, type) { GroupId = groupId; RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; CustomInit(); } @@ -66,5 +69,11 @@ public PrivateLinkResource() [JsonProperty(PropertyName = "properties.requiredMembers")] public IList RequiredMembers { get; private set; } + /// + /// Gets the private link resource required zone names. + /// + [JsonProperty(PropertyName = "properties.requiredZoneNames")] + public IList RequiredZoneNames { get; private set; } + } } diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.cs index 729e9869bebf..f8233bf25df4 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.cs @@ -33,15 +33,15 @@ public PrivateLinkServiceConnectionStateProperty() /// /// The private link service connection /// status. - /// The private link service connection - /// description. /// Any action that is required beyond /// basic workflow (approve/ reject/ disconnect) - public PrivateLinkServiceConnectionStateProperty(string status = default(string), string description = default(string), string actionsRequired = default(string)) + /// The private link service connection + /// description. + public PrivateLinkServiceConnectionStateProperty(string status = default(string), string actionsRequired = default(string), string description = default(string)) { Status = status; - Description = description; ActionsRequired = actionsRequired; + Description = description; CustomInit(); } @@ -56,12 +56,6 @@ public PrivateLinkServiceConnectionStateProperty() [JsonProperty(PropertyName = "status")] public string Status { get; set; } - /// - /// Gets or sets the private link service connection description. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - /// /// Gets any action that is required beyond basic workflow (approve/ /// reject/ disconnect) @@ -69,5 +63,11 @@ public PrivateLinkServiceConnectionStateProperty() [JsonProperty(PropertyName = "actionsRequired")] public string ActionsRequired { get; private set; } + /// + /// Gets or sets the private link service connection description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + } } diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesOptions.cs new file mode 100644 index 000000000000..040709e8ff24 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class SqlContainerGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the SqlContainerGetPropertiesOptions + /// class. + /// + public SqlContainerGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlContainerGetPropertiesOptions + /// class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public SqlContainerGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetResults.cs index 4ed50b3c17f1..241a58696957 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetResults.cs @@ -40,10 +40,11 @@ public SqlContainerGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public SqlContainerGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SqlContainerGetPropertiesResource resource = default(SqlContainerGetPropertiesResource)) + public SqlContainerGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SqlContainerGetPropertiesResource resource = default(SqlContainerGetPropertiesResource), SqlContainerGetPropertiesOptions options = default(SqlContainerGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public SqlContainerGetResults() [JsonProperty(PropertyName = "properties.resource")] public SqlContainerGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public SqlContainerGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesOptions.cs new file mode 100644 index 000000000000..95bf28400e59 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class SqlDatabaseGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the SqlDatabaseGetPropertiesOptions + /// class. + /// + public SqlDatabaseGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlDatabaseGetPropertiesOptions + /// class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public SqlDatabaseGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetResults.cs index 177bf31ead0b..1a16ae9b45b2 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetResults.cs @@ -40,10 +40,11 @@ public SqlDatabaseGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public SqlDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SqlDatabaseGetPropertiesResource resource = default(SqlDatabaseGetPropertiesResource)) + public SqlDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SqlDatabaseGetPropertiesResource resource = default(SqlDatabaseGetPropertiesResource), SqlDatabaseGetPropertiesOptions options = default(SqlDatabaseGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public SqlDatabaseGetResults() [JsonProperty(PropertyName = "properties.resource")] public SqlDatabaseGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public SqlDatabaseGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetPropertiesOptions.cs new file mode 100644 index 000000000000..c314559f5d77 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetPropertiesOptions.cs @@ -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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class TableGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the TableGetPropertiesOptions class. + /// + public TableGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TableGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public TableGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetResults.cs index 305a165e4c37..71b768ca4f6d 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetResults.cs @@ -40,10 +40,11 @@ public TableGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public TableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), TableGetPropertiesResource resource = default(TableGetPropertiesResource)) + public TableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), TableGetPropertiesResource resource = default(TableGetPropertiesResource), TableGetPropertiesOptions options = default(TableGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public TableGetResults() [JsonProperty(PropertyName = "properties.resource")] public TableGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public TableGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs index 18e4060dc723..20ab5067515f 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs @@ -55,7 +55,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -87,6 +87,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -125,7 +132,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -135,7 +152,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMongoDBDatabases", tracingParameters); } @@ -146,9 +162,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -280,7 +296,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -315,6 +331,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -357,7 +380,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -368,7 +401,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBDatabase", tracingParameters); } @@ -380,9 +412,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -513,7 +545,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Create or updates Azure Cosmos DB MongoDB database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -541,7 +573,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB MongoDB database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -567,7 +599,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -602,6 +634,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -644,7 +683,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -655,7 +704,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBDatabaseThroughput", tracingParameters); } @@ -667,9 +715,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -800,7 +848,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -830,7 +878,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -865,6 +913,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -907,7 +962,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -918,7 +983,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMongoDBCollections", tracingParameters); } @@ -930,9 +994,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1064,7 +1128,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1102,6 +1166,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1148,7 +1219,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1160,7 +1241,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBCollection", tracingParameters); } @@ -1173,9 +1253,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1306,7 +1386,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB MongoDB Collection /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1337,7 +1417,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1366,7 +1446,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Cosmos DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1404,6 +1484,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1450,7 +1537,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1462,7 +1559,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBCollectionThroughput", tracingParameters); } @@ -1475,9 +1571,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1608,7 +1704,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1640,7 +1736,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Create or updates Azure Cosmos DB MongoDB database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1678,6 +1774,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1720,6 +1823,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateMongoDBDatabaseParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateMongoDBDatabaseParameters"); @@ -1728,7 +1842,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { createUpdateMongoDBDatabaseParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1739,7 +1852,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateMongoDBDatabaseParameters", createUpdateMongoDBDatabaseParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoDBDatabase", tracingParameters); @@ -1752,9 +1864,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1812,7 +1924,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1821,10 +1932,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -1896,7 +2003,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB MongoDB database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1928,6 +2035,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1970,7 +2084,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1981,7 +2105,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoDBDatabase", tracingParameters); } @@ -1993,9 +2116,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2047,7 +2170,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2056,10 +2178,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2113,7 +2231,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2152,6 +2270,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2194,6 +2319,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -2202,7 +2338,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2213,7 +2348,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateMongoDBDatabaseThroughput", tracingParameters); @@ -2226,9 +2360,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2286,7 +2420,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2295,10 +2428,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2370,7 +2499,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB MongoDB Collection /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2411,6 +2540,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2457,6 +2593,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateMongoDBCollectionParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateMongoDBCollectionParameters"); @@ -2465,7 +2612,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { createUpdateMongoDBCollectionParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2477,7 +2623,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateMongoDBCollectionParameters", createUpdateMongoDBCollectionParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoDBCollection", tracingParameters); @@ -2491,9 +2636,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2551,7 +2696,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2560,10 +2704,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2635,7 +2775,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2670,6 +2810,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2716,7 +2863,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2728,7 +2885,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoDBCollection", tracingParameters); } @@ -2741,9 +2897,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2795,7 +2951,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2804,10 +2959,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2861,7 +3012,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2903,6 +3054,13 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2949,6 +3107,17 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "collectionName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -2957,7 +3126,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2969,7 +3137,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateMongoDBCollectionThroughput", tracingParameters); @@ -2983,9 +3150,9 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3050,12 +3217,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperationsExtensions.cs index 60840ef04d2a..b0b25e697386 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class MongoDBResourcesOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -49,7 +49,7 @@ public static IEnumerable ListMongoDBDatabases(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -73,7 +73,7 @@ public static IEnumerable ListMongoDBDatabases(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -94,7 +94,7 @@ public static MongoDBDatabaseGetResults GetMongoDBDatabase(this IMongoDBResource /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -120,7 +120,7 @@ public static MongoDBDatabaseGetResults GetMongoDBDatabase(this IMongoDBResource /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -143,7 +143,7 @@ public static MongoDBDatabaseGetResults CreateUpdateMongoDBDatabase(this IMongoD /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -172,7 +172,7 @@ public static MongoDBDatabaseGetResults CreateUpdateMongoDBDatabase(this IMongoD /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -192,7 +192,7 @@ public static void DeleteMongoDBDatabase(this IMongoDBResourcesOperations operat /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -216,7 +216,7 @@ public static void DeleteMongoDBDatabase(this IMongoDBResourcesOperations operat /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -237,7 +237,7 @@ public static ThroughputSettingsGetResults GetMongoDBDatabaseThroughput(this IMo /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -263,7 +263,7 @@ public static ThroughputSettingsGetResults GetMongoDBDatabaseThroughput(this IMo /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -287,7 +287,7 @@ public static ThroughputSettingsGetResults UpdateMongoDBDatabaseThroughput(this /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -318,7 +318,7 @@ public static ThroughputSettingsGetResults UpdateMongoDBDatabaseThroughput(this /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -339,7 +339,7 @@ public static IEnumerable ListMongoDBCollections(th /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -366,7 +366,7 @@ public static IEnumerable ListMongoDBCollections(th /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -390,7 +390,7 @@ public static MongoDBCollectionGetResults GetMongoDBCollection(this IMongoDBReso /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -419,7 +419,7 @@ public static MongoDBCollectionGetResults GetMongoDBCollection(this IMongoDBReso /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -445,7 +445,7 @@ public static MongoDBCollectionGetResults CreateUpdateMongoDBCollection(this IMo /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -477,7 +477,7 @@ public static MongoDBCollectionGetResults CreateUpdateMongoDBCollection(this IMo /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -500,7 +500,7 @@ public static void DeleteMongoDBCollection(this IMongoDBResourcesOperations oper /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -527,7 +527,7 @@ public static void DeleteMongoDBCollection(this IMongoDBResourcesOperations oper /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -551,7 +551,7 @@ public static ThroughputSettingsGetResults GetMongoDBCollectionThroughput(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -580,7 +580,7 @@ public static ThroughputSettingsGetResults GetMongoDBCollectionThroughput(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -607,7 +607,7 @@ public static ThroughputSettingsGetResults UpdateMongoDBCollectionThroughput(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -640,7 +640,7 @@ public static ThroughputSettingsGetResults UpdateMongoDBCollectionThroughput(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -663,7 +663,7 @@ public static MongoDBDatabaseGetResults BeginCreateUpdateMongoDBDatabase(this IM /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -692,7 +692,7 @@ public static MongoDBDatabaseGetResults BeginCreateUpdateMongoDBDatabase(this IM /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -712,7 +712,7 @@ public static void BeginDeleteMongoDBDatabase(this IMongoDBResourcesOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -735,7 +735,7 @@ public static void BeginDeleteMongoDBDatabase(this IMongoDBResourcesOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -759,7 +759,7 @@ public static ThroughputSettingsGetResults BeginUpdateMongoDBDatabaseThroughput( /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -789,7 +789,7 @@ public static ThroughputSettingsGetResults BeginUpdateMongoDBDatabaseThroughput( /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -815,7 +815,7 @@ public static MongoDBCollectionGetResults BeginCreateUpdateMongoDBCollection(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -847,7 +847,7 @@ public static MongoDBCollectionGetResults BeginCreateUpdateMongoDBCollection(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -870,7 +870,7 @@ public static void BeginDeleteMongoDBCollection(this IMongoDBResourcesOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -896,7 +896,7 @@ public static void BeginDeleteMongoDBCollection(this IMongoDBResourcesOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -923,7 +923,7 @@ public static ThroughputSettingsGetResults BeginUpdateMongoDBCollectionThroughpu /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs new file mode 100644 index 000000000000..d390df69ecdd --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs @@ -0,0 +1,1687 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NotebookWorkspacesOperations operations. + /// + internal partial class NotebookWorkspacesOperations : IServiceOperations, INotebookWorkspacesOperations + { + /// + /// Initializes a new instance of the NotebookWorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NotebookWorkspacesOperations(CosmosDBManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the CosmosDBManagementClient + /// + public CosmosDBManagementClient Client { get; private set; } + + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseAccount", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the connection info for the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListConnectionInfoWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionInfo", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters = new NotebookWorkspaceCreateUpdateParameters(); + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("notebookCreateUpdateParameters", notebookCreateUpdateParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(notebookCreateUpdateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(notebookCreateUpdateParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRegenerateAuthToken", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Starts the notebook workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperationsExtensions.cs new file mode 100644 index 000000000000..bf9246dabbbc --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperationsExtensions.cs @@ -0,0 +1,449 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NotebookWorkspacesOperations. + /// + public static partial class NotebookWorkspacesOperationsExtensions + { + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static IEnumerable ListByDatabaseAccount(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.ListByDatabaseAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDatabaseAccountAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static NotebookWorkspace Get(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Gets the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static NotebookWorkspace CreateOrUpdate(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.CreateOrUpdateAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static void Delete(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Retrieves the connection info for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static NotebookWorkspaceConnectionInfoResult ListConnectionInfo(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.ListConnectionInfoAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the connection info for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task ListConnectionInfoAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListConnectionInfoWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static void RegenerateAuthToken(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.RegenerateAuthTokenAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task RegenerateAuthTokenAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static void Start(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.StartAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task StartAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static NotebookWorkspace BeginCreateOrUpdate(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static void BeginDelete(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.BeginDeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static void BeginRegenerateAuthToken(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.BeginRegenerateAuthTokenAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRegenerateAuthTokenAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static void BeginStart(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.BeginStartAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginStartAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Operations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Operations.cs index e3edc7b5b814..8253fb04378d 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Operations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Operations.cs @@ -65,12 +65,28 @@ internal Operations(CosmosDBManagementClient client) /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -78,7 +94,6 @@ internal Operations(CosmosDBManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -86,9 +101,9 @@ internal Operations(CosmosDBManagementClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DocumentDB/operations").ToString(); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs index 3d9b9abc234a..1590e2151a3a 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs @@ -55,7 +55,7 @@ internal PartitionKeyRangeIdOperations(CosmosDBManagementClient client) /// partition key range id. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -102,6 +102,13 @@ internal PartitionKeyRangeIdOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -152,11 +159,21 @@ internal PartitionKeyRangeIdOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "partitionKeyRangeId"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -169,7 +186,6 @@ internal PartitionKeyRangeIdOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); tracingParameters.Add("partitionKeyRangeId", partitionKeyRangeId); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -184,9 +200,9 @@ internal PartitionKeyRangeIdOperations(CosmosDBManagementClient client) _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); _url = _url.Replace("{partitionKeyRangeId}", System.Uri.EscapeDataString(partitionKeyRangeId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperationsExtensions.cs index 1b6470299e2c..90789fc3f7a0 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class PartitionKeyRangeIdOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -64,7 +64,7 @@ public static IEnumerable ListMetrics(this IPartitionKeyRangeId /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs index 4ed42e499e69..6a118c9fda03 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs @@ -55,7 +55,7 @@ internal PartitionKeyRangeIdRegionOperations(CosmosDBManagementClient client) /// partition key range id and region. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -105,6 +105,13 @@ internal PartitionKeyRangeIdRegionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -159,11 +166,21 @@ internal PartitionKeyRangeIdRegionOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "partitionKeyRangeId"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -177,7 +194,6 @@ internal PartitionKeyRangeIdRegionOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseRid", databaseRid); tracingParameters.Add("collectionRid", collectionRid); tracingParameters.Add("partitionKeyRangeId", partitionKeyRangeId); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -193,9 +209,9 @@ internal PartitionKeyRangeIdRegionOperations(CosmosDBManagementClient client) _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); _url = _url.Replace("{partitionKeyRangeId}", System.Uri.EscapeDataString(partitionKeyRangeId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperationsExtensions.cs index ac124a6a5830..937e04f3e81d 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class PartitionKeyRangeIdRegionOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -67,7 +67,7 @@ public static IEnumerable ListMetrics(this IPartitionKeyRangeId /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperations.cs index 76339409b5a2..8c37a40f2cb1 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperations.cs @@ -55,7 +55,7 @@ internal PercentileOperations(CosmosDBManagementClient client) /// account. This url is only for PBS and Replication Latency data /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -93,6 +93,13 @@ internal PercentileOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -131,11 +138,21 @@ internal PercentileOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -145,7 +162,6 @@ internal PercentileOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -157,9 +173,9 @@ internal PercentileOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperationsExtensions.cs index 324c53ca45ae..7913db83cbf2 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class PercentileOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -55,7 +55,7 @@ public static IEnumerable ListMetrics(this IPercentileOperatio /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs index ab1a20f849d5..125a8300bd6a 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs @@ -56,7 +56,7 @@ internal PercentileSourceTargetOperations(CosmosDBManagementClient client) /// data /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -102,6 +102,13 @@ internal PercentileSourceTargetOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -148,11 +155,21 @@ internal PercentileSourceTargetOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "targetRegion"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -164,7 +181,6 @@ internal PercentileSourceTargetOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("sourceRegion", sourceRegion); tracingParameters.Add("targetRegion", targetRegion); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -178,9 +194,9 @@ internal PercentileSourceTargetOperations(CosmosDBManagementClient client) _url = _url.Replace("{sourceRegion}", System.Uri.EscapeDataString(sourceRegion)); _url = _url.Replace("{targetRegion}", System.Uri.EscapeDataString(targetRegion)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperationsExtensions.cs index 05046e5040e0..14ac5fdec3eb 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperationsExtensions.cs @@ -32,7 +32,7 @@ public static partial class PercentileSourceTargetOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -65,7 +65,7 @@ public static IEnumerable ListMetrics(this IPercentileSourceTa /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperations.cs index 6bcb6fcd4e02..3170cdfc1754 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperations.cs @@ -55,7 +55,7 @@ internal PercentileTargetOperations(CosmosDBManagementClient client) /// target region. This url is only for PBS and Replication Latency data /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -97,6 +97,13 @@ internal PercentileTargetOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -139,11 +146,21 @@ internal PercentileTargetOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "targetRegion"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (filter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -154,7 +171,6 @@ internal PercentileTargetOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("targetRegion", targetRegion); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); @@ -167,9 +183,9 @@ internal PercentileTargetOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{targetRegion}", System.Uri.EscapeDataString(targetRegion)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (filter != null) { diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperationsExtensions.cs index 02fa98041f91..d32154981c56 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class PercentileTargetOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -59,7 +59,7 @@ public static IEnumerable ListMetrics(this IPercentileTargetOp /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs index 673b9aebd2c7..bfffd7c20598 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs @@ -55,7 +55,7 @@ internal PrivateLinkResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -87,6 +87,13 @@ internal PrivateLinkResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -280,7 +287,7 @@ internal PrivateLinkResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -315,6 +322,13 @@ internal PrivateLinkResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperationsExtensions.cs index 05fb6d02a0e4..124eb12f65dc 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class PrivateLinkResourcesOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -49,7 +49,7 @@ public static IEnumerable ListByDatabaseAccount(this IPriva /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -73,7 +73,7 @@ public static IEnumerable ListByDatabaseAccount(this IPriva /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -94,7 +94,7 @@ public static PrivateLinkResource Get(this IPrivateLinkResourcesOperations opera /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs index c1fe9313fd27..fe248a222c28 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs @@ -29,6 +29,7 @@ public static IEnumerable> ApiInfo_CosmosDBManagem new Tuple("DocumentDB", "DatabaseAccounts", "2020-03-01"), new Tuple("DocumentDB", "GremlinResources", "2020-03-01"), new Tuple("DocumentDB", "MongoDBResources", "2020-03-01"), + new Tuple("DocumentDB", "NotebookWorkspaces", "2019-08-01"), new Tuple("DocumentDB", "Operations", "2020-03-01"), new Tuple("DocumentDB", "PartitionKeyRangeId", "2020-03-01"), new Tuple("DocumentDB", "PartitionKeyRangeIdRegion", "2020-03-01"), @@ -42,16 +43,5 @@ public static IEnumerable> ApiInfo_CosmosDBManagem }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cosmos-db/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\azure-sdk-for-net2\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "ef3a1ab6db775897bfc13f921e0e489ca4d58be5"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperations.cs index bd4abc1f4076..4fc5db43b3ad 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperations.cs @@ -54,7 +54,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Lists the SQL databases under an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -86,6 +86,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -124,7 +131,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -134,7 +151,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListSqlDatabases", tracingParameters); } @@ -145,9 +161,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -279,7 +295,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -314,6 +330,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -356,7 +379,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -367,7 +400,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSqlDatabase", tracingParameters); } @@ -379,9 +411,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -512,7 +544,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -540,7 +572,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -566,7 +598,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// DB database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -601,6 +633,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -643,7 +682,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -654,7 +703,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSqlDatabaseThroughput", tracingParameters); } @@ -666,9 +714,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -799,7 +847,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB SQL database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -828,7 +876,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Lists the SQL container under an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -863,6 +911,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -905,7 +960,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -916,7 +981,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListSqlContainers", tracingParameters); } @@ -928,9 +992,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1061,7 +1125,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1099,6 +1163,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1145,7 +1216,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1157,7 +1238,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSqlContainer", tracingParameters); } @@ -1170,9 +1250,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1303,7 +1383,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL container /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1334,7 +1414,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL container. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1363,7 +1443,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1401,6 +1481,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1447,7 +1534,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1459,7 +1556,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSqlContainerThroughput", tracingParameters); } @@ -1472,9 +1568,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1605,7 +1701,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB SQL container /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1638,7 +1734,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1676,6 +1772,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1722,7 +1825,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1734,7 +1847,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListSqlStoredProcedures", tracingParameters); } @@ -1747,9 +1859,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1881,7 +1993,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1922,6 +2034,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1972,7 +2091,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "storedProcedureName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1985,7 +2114,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("storedProcedureName", storedProcedureName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSqlStoredProcedure", tracingParameters); } @@ -1999,9 +2127,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2132,7 +2260,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2166,7 +2294,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2198,7 +2326,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2236,6 +2364,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2282,7 +2417,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2294,7 +2439,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListSqlUserDefinedFunctions", tracingParameters); } @@ -2307,9 +2451,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2441,7 +2585,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2482,6 +2626,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2532,7 +2683,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "userDefinedFunctionName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2545,7 +2706,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("userDefinedFunctionName", userDefinedFunctionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSqlUserDefinedFunction", tracingParameters); } @@ -2559,9 +2719,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{userDefinedFunctionName}", System.Uri.EscapeDataString(userDefinedFunctionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2692,7 +2852,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2726,7 +2886,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2757,7 +2917,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Lists the SQL trigger under an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -2795,6 +2955,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2841,7 +3008,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2853,7 +3030,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListSqlTriggers", tracingParameters); } @@ -2866,9 +3042,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2999,7 +3175,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Gets the SQL trigger under an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3040,6 +3216,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3090,7 +3273,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3103,7 +3296,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSqlTrigger", tracingParameters); } @@ -3117,9 +3309,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3250,7 +3442,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL trigger /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3284,7 +3476,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3315,7 +3507,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3353,6 +3545,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3395,6 +3594,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateSqlDatabaseParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateSqlDatabaseParameters"); @@ -3403,7 +3613,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { createUpdateSqlDatabaseParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3414,7 +3623,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateSqlDatabaseParameters", createUpdateSqlDatabaseParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlDatabase", tracingParameters); @@ -3427,9 +3635,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3487,7 +3695,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3496,10 +3703,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3571,7 +3774,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL database. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3603,6 +3806,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3645,7 +3855,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3656,7 +3876,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlDatabase", tracingParameters); } @@ -3668,9 +3887,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3722,7 +3941,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3731,10 +3949,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3788,7 +4002,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB SQL database /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -3827,6 +4041,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3869,6 +4090,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -3877,7 +4109,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3888,7 +4119,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateSqlDatabaseThroughput", tracingParameters); @@ -3901,9 +4131,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3961,7 +4191,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3970,10 +4199,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -4045,7 +4270,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL container /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -4086,6 +4311,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4132,6 +4364,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateSqlContainerParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateSqlContainerParameters"); @@ -4140,7 +4383,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { createUpdateSqlContainerParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4152,7 +4394,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateSqlContainerParameters", createUpdateSqlContainerParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlContainer", tracingParameters); @@ -4166,9 +4407,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4226,7 +4467,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -4235,10 +4475,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -4310,7 +4546,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL container. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -4345,6 +4581,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4391,7 +4634,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4403,7 +4656,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlContainer", tracingParameters); } @@ -4416,9 +4668,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4470,7 +4722,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -4479,10 +4730,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -4536,7 +4783,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB SQL container /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -4578,6 +4825,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4624,6 +4878,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -4632,7 +4897,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4644,7 +4908,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateSqlContainerThroughput", tracingParameters); @@ -4658,9 +4921,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4718,7 +4981,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -4727,10 +4989,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -4802,7 +5060,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -4846,6 +5104,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4896,6 +5161,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "storedProcedureName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateSqlStoredProcedureParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateSqlStoredProcedureParameters"); @@ -4904,7 +5180,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { createUpdateSqlStoredProcedureParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4917,7 +5192,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("storedProcedureName", storedProcedureName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateSqlStoredProcedureParameters", createUpdateSqlStoredProcedureParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlStoredProcedure", tracingParameters); @@ -4932,9 +5206,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4992,7 +5266,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -5001,10 +5274,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -5076,7 +5345,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -5114,6 +5383,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5164,7 +5440,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "storedProcedureName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5177,7 +5463,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("storedProcedureName", storedProcedureName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlStoredProcedure", tracingParameters); } @@ -5191,9 +5476,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5245,7 +5530,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -5254,10 +5538,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -5311,7 +5591,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -5355,6 +5635,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5405,6 +5692,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "userDefinedFunctionName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateSqlUserDefinedFunctionParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateSqlUserDefinedFunctionParameters"); @@ -5413,7 +5711,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { createUpdateSqlUserDefinedFunctionParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5426,7 +5723,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("userDefinedFunctionName", userDefinedFunctionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateSqlUserDefinedFunctionParameters", createUpdateSqlUserDefinedFunctionParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlUserDefinedFunction", tracingParameters); @@ -5441,9 +5737,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{userDefinedFunctionName}", System.Uri.EscapeDataString(userDefinedFunctionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5501,7 +5797,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -5510,10 +5805,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -5585,7 +5876,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -5623,6 +5914,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5673,7 +5971,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "userDefinedFunctionName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5686,7 +5994,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("userDefinedFunctionName", userDefinedFunctionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlUserDefinedFunction", tracingParameters); } @@ -5700,9 +6007,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{userDefinedFunctionName}", System.Uri.EscapeDataString(userDefinedFunctionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5754,7 +6061,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -5763,10 +6069,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -5820,7 +6122,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB SQL trigger /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -5864,6 +6166,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5914,6 +6223,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateSqlTriggerParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateSqlTriggerParameters"); @@ -5922,7 +6242,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { createUpdateSqlTriggerParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5935,7 +6254,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateSqlTriggerParameters", createUpdateSqlTriggerParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlTrigger", tracingParameters); @@ -5950,9 +6268,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6010,7 +6328,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -6019,10 +6336,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -6094,7 +6407,7 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -6132,6 +6445,13 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -6182,7 +6502,17 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -6195,7 +6525,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlTrigger", tracingParameters); } @@ -6209,9 +6538,9 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6263,7 +6592,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -6272,10 +6600,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperationsExtensions.cs index 65a996c6ab4c..1a3cbe5711af 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class SqlResourcesOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -47,7 +47,7 @@ public static IEnumerable ListSqlDatabases(this ISqlResou /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -71,7 +71,7 @@ public static IEnumerable ListSqlDatabases(this ISqlResou /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -92,7 +92,7 @@ public static SqlDatabaseGetResults GetSqlDatabase(this ISqlResourcesOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -118,7 +118,7 @@ public static SqlDatabaseGetResults GetSqlDatabase(this ISqlResourcesOperations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -141,7 +141,7 @@ public static SqlDatabaseGetResults CreateUpdateSqlDatabase(this ISqlResourcesOp /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -170,7 +170,7 @@ public static SqlDatabaseGetResults CreateUpdateSqlDatabase(this ISqlResourcesOp /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -190,7 +190,7 @@ public static void DeleteSqlDatabase(this ISqlResourcesOperations operations, st /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -214,7 +214,7 @@ public static void DeleteSqlDatabase(this ISqlResourcesOperations operations, st /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -235,7 +235,7 @@ public static ThroughputSettingsGetResults GetSqlDatabaseThroughput(this ISqlRes /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -261,7 +261,7 @@ public static ThroughputSettingsGetResults GetSqlDatabaseThroughput(this ISqlRes /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -285,7 +285,7 @@ public static ThroughputSettingsGetResults UpdateSqlDatabaseThroughput(this ISql /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -315,7 +315,7 @@ public static ThroughputSettingsGetResults UpdateSqlDatabaseThroughput(this ISql /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -335,7 +335,7 @@ public static IEnumerable ListSqlContainers(this ISqlRes /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -361,7 +361,7 @@ public static IEnumerable ListSqlContainers(this ISqlRes /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -384,7 +384,7 @@ public static SqlContainerGetResults GetSqlContainer(this ISqlResourcesOperation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -413,7 +413,7 @@ public static SqlContainerGetResults GetSqlContainer(this ISqlResourcesOperation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -439,7 +439,7 @@ public static SqlContainerGetResults CreateUpdateSqlContainer(this ISqlResources /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -471,7 +471,7 @@ public static SqlContainerGetResults CreateUpdateSqlContainer(this ISqlResources /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -494,7 +494,7 @@ public static void DeleteSqlContainer(this ISqlResourcesOperations operations, s /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -521,7 +521,7 @@ public static void DeleteSqlContainer(this ISqlResourcesOperations operations, s /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -545,7 +545,7 @@ public static ThroughputSettingsGetResults GetSqlContainerThroughput(this ISqlRe /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -574,7 +574,7 @@ public static ThroughputSettingsGetResults GetSqlContainerThroughput(this ISqlRe /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -601,7 +601,7 @@ public static ThroughputSettingsGetResults UpdateSqlContainerThroughput(this ISq /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -635,7 +635,7 @@ public static ThroughputSettingsGetResults UpdateSqlContainerThroughput(this ISq /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -659,7 +659,7 @@ public static IEnumerable ListSqlStoredProcedures( /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -689,7 +689,7 @@ public static IEnumerable ListSqlStoredProcedures( /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -716,7 +716,7 @@ public static SqlStoredProcedureGetResults GetSqlStoredProcedure(this ISqlResour /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -748,7 +748,7 @@ public static SqlStoredProcedureGetResults GetSqlStoredProcedure(this ISqlResour /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -777,7 +777,7 @@ public static SqlStoredProcedureGetResults CreateUpdateSqlStoredProcedure(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -812,7 +812,7 @@ public static SqlStoredProcedureGetResults CreateUpdateSqlStoredProcedure(this I /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -838,7 +838,7 @@ public static void DeleteSqlStoredProcedure(this ISqlResourcesOperations operati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -868,7 +868,7 @@ public static void DeleteSqlStoredProcedure(this ISqlResourcesOperations operati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -892,7 +892,7 @@ public static IEnumerable ListSqlUserDefinedFu /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -922,7 +922,7 @@ public static IEnumerable ListSqlUserDefinedFu /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -949,7 +949,7 @@ public static SqlUserDefinedFunctionGetResults GetSqlUserDefinedFunction(this IS /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -981,7 +981,7 @@ public static SqlUserDefinedFunctionGetResults GetSqlUserDefinedFunction(this IS /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1010,7 +1010,7 @@ public static SqlUserDefinedFunctionGetResults CreateUpdateSqlUserDefinedFunctio /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1045,7 +1045,7 @@ public static SqlUserDefinedFunctionGetResults CreateUpdateSqlUserDefinedFunctio /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1071,7 +1071,7 @@ public static void DeleteSqlUserDefinedFunction(this ISqlResourcesOperations ope /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1100,7 +1100,7 @@ public static void DeleteSqlUserDefinedFunction(this ISqlResourcesOperations ope /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1123,7 +1123,7 @@ public static IEnumerable ListSqlTriggers(this ISqlResourc /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1152,7 +1152,7 @@ public static IEnumerable ListSqlTriggers(this ISqlResourc /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1178,7 +1178,7 @@ public static SqlTriggerGetResults GetSqlTrigger(this ISqlResourcesOperations op /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1210,7 +1210,7 @@ public static SqlTriggerGetResults GetSqlTrigger(this ISqlResourcesOperations op /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1239,7 +1239,7 @@ public static SqlTriggerGetResults CreateUpdateSqlTrigger(this ISqlResourcesOper /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1274,7 +1274,7 @@ public static SqlTriggerGetResults CreateUpdateSqlTrigger(this ISqlResourcesOper /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1300,7 +1300,7 @@ public static void DeleteSqlTrigger(this ISqlResourcesOperations operations, str /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1329,7 +1329,7 @@ public static void DeleteSqlTrigger(this ISqlResourcesOperations operations, str /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1352,7 +1352,7 @@ public static SqlDatabaseGetResults BeginCreateUpdateSqlDatabase(this ISqlResour /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1381,7 +1381,7 @@ public static SqlDatabaseGetResults BeginCreateUpdateSqlDatabase(this ISqlResour /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1401,7 +1401,7 @@ public static void BeginDeleteSqlDatabase(this ISqlResourcesOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1424,7 +1424,7 @@ public static void BeginDeleteSqlDatabase(this ISqlResourcesOperations operation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1448,7 +1448,7 @@ public static ThroughputSettingsGetResults BeginUpdateSqlDatabaseThroughput(this /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1478,7 +1478,7 @@ public static ThroughputSettingsGetResults BeginUpdateSqlDatabaseThroughput(this /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1504,7 +1504,7 @@ public static SqlContainerGetResults BeginCreateUpdateSqlContainer(this ISqlReso /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1536,7 +1536,7 @@ public static SqlContainerGetResults BeginCreateUpdateSqlContainer(this ISqlReso /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1559,7 +1559,7 @@ public static void BeginDeleteSqlContainer(this ISqlResourcesOperations operatio /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1585,7 +1585,7 @@ public static void BeginDeleteSqlContainer(this ISqlResourcesOperations operatio /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1612,7 +1612,7 @@ public static ThroughputSettingsGetResults BeginUpdateSqlContainerThroughput(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1645,7 +1645,7 @@ public static ThroughputSettingsGetResults BeginUpdateSqlContainerThroughput(thi /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1674,7 +1674,7 @@ public static SqlStoredProcedureGetResults BeginCreateUpdateSqlStoredProcedure(t /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1709,7 +1709,7 @@ public static SqlStoredProcedureGetResults BeginCreateUpdateSqlStoredProcedure(t /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1735,7 +1735,7 @@ public static void BeginDeleteSqlStoredProcedure(this ISqlResourcesOperations op /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1764,7 +1764,7 @@ public static void BeginDeleteSqlStoredProcedure(this ISqlResourcesOperations op /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1793,7 +1793,7 @@ public static SqlUserDefinedFunctionGetResults BeginCreateUpdateSqlUserDefinedFu /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1828,7 +1828,7 @@ public static SqlUserDefinedFunctionGetResults BeginCreateUpdateSqlUserDefinedFu /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1854,7 +1854,7 @@ public static void BeginDeleteSqlUserDefinedFunction(this ISqlResourcesOperation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1883,7 +1883,7 @@ public static void BeginDeleteSqlUserDefinedFunction(this ISqlResourcesOperation /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1912,7 +1912,7 @@ public static SqlTriggerGetResults BeginCreateUpdateSqlTrigger(this ISqlResource /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1947,7 +1947,7 @@ public static SqlTriggerGetResults BeginCreateUpdateSqlTrigger(this ISqlResource /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1973,7 +1973,7 @@ public static void BeginDeleteSqlTrigger(this ISqlResourcesOperations operations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperations.cs index b9b765091db5..db6cb36dc7dd 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperations.cs @@ -54,7 +54,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// Lists the Tables under an existing Azure Cosmos DB database account. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -86,6 +86,13 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -124,7 +131,17 @@ internal TableResourcesOperations(CosmosDBManagementClient client) throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -134,7 +151,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListTables", tracingParameters); } @@ -145,9 +161,9 @@ internal TableResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -279,7 +295,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -314,6 +330,13 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -356,7 +379,17 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -367,7 +400,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetTable", tracingParameters); } @@ -379,9 +411,9 @@ internal TableResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -512,7 +544,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -540,7 +572,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Table. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -566,7 +598,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// database account with the provided name. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -601,6 +633,13 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -643,7 +682,17 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -654,7 +703,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetTableThroughput", tracingParameters); } @@ -666,9 +714,9 @@ internal TableResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -799,7 +847,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -827,7 +875,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// Create or update an Azure Cosmos DB Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -865,6 +913,13 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -907,6 +962,17 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (createUpdateTableParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "createUpdateTableParameters"); @@ -915,7 +981,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { createUpdateTableParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -926,7 +991,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateTableParameters", createUpdateTableParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateTable", tracingParameters); @@ -939,9 +1003,9 @@ internal TableResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -999,7 +1063,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1008,10 +1071,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -1083,7 +1142,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// Deletes an existing Azure Cosmos DB Table. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1115,6 +1174,13 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1157,7 +1223,17 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-03-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1168,7 +1244,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteTable", tracingParameters); } @@ -1180,9 +1255,9 @@ internal TableResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1234,7 +1309,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1243,10 +1317,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -1300,7 +1370,7 @@ internal TableResourcesOperations(CosmosDBManagementClient client) /// Update RUs per second of an Azure Cosmos DB Table /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -1338,6 +1408,13 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1380,6 +1457,17 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } if (updateThroughputParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateThroughputParameters"); @@ -1388,7 +1476,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) { updateThroughputParameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1399,7 +1486,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTableThroughput", tracingParameters); @@ -1412,9 +1498,9 @@ internal TableResourcesOperations(CosmosDBManagementClient client) _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1472,7 +1558,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1481,10 +1566,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperationsExtensions.cs index 327bf09baaa0..f5741380520f 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperationsExtensions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperationsExtensions.cs @@ -30,7 +30,7 @@ public static partial class TableResourcesOperationsExtensions /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -47,7 +47,7 @@ public static IEnumerable ListTables(this ITableResourcesOperat /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -71,7 +71,7 @@ public static IEnumerable ListTables(this ITableResourcesOperat /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -92,7 +92,7 @@ public static TableGetResults GetTable(this ITableResourcesOperations operations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -118,7 +118,7 @@ public static TableGetResults GetTable(this ITableResourcesOperations operations /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -141,7 +141,7 @@ public static TableGetResults CreateUpdateTable(this ITableResourcesOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -170,7 +170,7 @@ public static TableGetResults CreateUpdateTable(this ITableResourcesOperations o /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -190,7 +190,7 @@ public static void DeleteTable(this ITableResourcesOperations operations, string /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -214,7 +214,7 @@ public static void DeleteTable(this ITableResourcesOperations operations, string /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -235,7 +235,7 @@ public static ThroughputSettingsGetResults GetTableThroughput(this ITableResourc /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -261,7 +261,7 @@ public static ThroughputSettingsGetResults GetTableThroughput(this ITableResourc /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -284,7 +284,7 @@ public static ThroughputSettingsGetResults UpdateTableThroughput(this ITableReso /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -313,7 +313,7 @@ public static ThroughputSettingsGetResults UpdateTableThroughput(this ITableReso /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -336,7 +336,7 @@ public static TableGetResults BeginCreateUpdateTable(this ITableResourcesOperati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -365,7 +365,7 @@ public static TableGetResults BeginCreateUpdateTable(this ITableResourcesOperati /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -385,7 +385,7 @@ public static void BeginDeleteTable(this ITableResourcesOperations operations, s /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -408,7 +408,7 @@ public static void BeginDeleteTable(this ITableResourcesOperations operations, s /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. @@ -431,7 +431,7 @@ public static ThroughputSettingsGetResults BeginUpdateTableThroughput(this ITabl /// The operations group for this extension method. /// /// - /// Name of an Azure resource group. + /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name.